Skip to main content
Persona is built on a hybrid architecture that treats the graph database as both a vector store and a structured knowledge graph. This dual nature allows it to perform complex reasoning that neither pure vector search nor traditional graph queries can achieve alone.

The Ingestion Pipeline

The ingestion process is the “write” side of the architecture. It transforms raw, unstructured data into a structured memory graph. The entry point is the PersonaAdapter, a unified interface that handles data from any source—whether it’s a chat log, a note, or an email. When content enters the pipeline, it passes through the IngestionService, which uses a Large Language Model to perform extraction. The LLM analyzes the text to identify three distinct types of memory:
  • Episodes: The narrative record of what happened.
  • Psyche: Traits, preferences, and values that define the user’s identity.
  • Goals: Actionable tasks or long-term objectives.
Once extracted, these memories are embedded into vector space. The MemoryStore then persists them to the graph, crucially handling the linking process. It automatically creates temporal links (PREVIOUS/NEXT) to chain episodes together in time, and semantic links (derived_from) to connect psyche traits and goals back to the episodes where they originated.

The Retrieval Pipeline

The retrieval process is the “read” side, designed to reconstruct context for an agent depending on the user’s query. The entry point is the Retriever, which executes a multi-stage hybrid algorithm. Stage 1: Vector Search The system embeds the incoming query and searches the vector index for “seed memories”—nodes that are semantically relevant to the topic at hand. Stage 2: Graph Crawl Starting from these seeds, the system traverses the graph structure. It follows relationships to find connected memories that vector search would miss. It might follow a causal link to find what led to a decision, or a temporal link to see what happened next. Stage 3: Static Context Finally, the system injects “always-on” context—specifically, active goals and core psyche traits. This ensures that even if a query doesn’t explicitly mention them, the agent remains aware of the user’s broader identity and objectives. The result is passed to the ContextFormatter, which structures the memories into a coherent XML prompt for the consuming agent.

The Data Layer

At the foundation lies the Data Layer. The MemoryStore acts as the abstraction for all CRUD operations, ensuring that the application logic remains decoupled from the physical storage. Below this is GraphOps, the low-level driver that manages database connections. The physical storage engine is Neo4j, which serves as both the graph database (storing nodes and relationships) and the vector index (storing embeddings). This unified storage model eliminates the need to synchronize a separate vector database with a graph database, ensuring data consistency and simplifying operations.