Add cognee + flyte sleep/wake memory store tutorial#249
Open
AdilFayyaz wants to merge 8 commits into
Open
Conversation
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Adds a new end-to-end tutorial demonstrating a production-grade sleep/wake memory architecture for AI agents. Showcases
flyte.map.aio,flyte.io.Dir,report=True,cache="auto", andflyte.app.AppEnvironmentin a realistic multi-session agentic application.Summary
memory_store.py— audited, versioned, file-based memory store synced viaflyte.io.Dir; prefix-based access control, optimistic concurrency (SHA-256 preconditions), immutable version history, and multi-session isolation underuser/sessions/<name>/memories/agent.py— staged proposal pipeline: untrusted writes land instaging/sessions/<session>/inbox/, validated against prompt-injection heuristics, then auto-promoted by the sleep cycleworkflow.py— Flyte tasks:ingest_url(BFS crawl + Cognee graph indexing),consolidate_cluster(parallel Claude memory merges viaflyte.map.aio),sleep_cycle(scheduled every 6h),wake_cycle(per-question retrieval with raw-file fallback when Cognee graph is incomplete),summarize_chat_sessionapp.py— Streamlit UI served viaflyte.app.AppEnvironment; session selector, URL ingestion, inline memory proposal cards (accept/edit/deny), sleep cycle trigger; fixes_configure_cognee_runtimemissing from local retrieval path andSearchResulttext extraction usingstr(r)instead ofr.search_resultTest Plan
python v2/tutorials/cognee_memory_store/memory_store.py— built-in self-check (write, concurrency, access control, audit)SELF_CHECK=true python v2/tutorials/cognee_memory_store/app.py— app self-checkuv run v2/tutorials/cognee_memory_store/app.py— deploys to Union; ingest a URL, ask a question, verifyctx_chars > 0in debug captions (AI_MEMORY_STORE_DEBUG=1)user/sessions/<session>/memories/and not the other