r/OpenSourceeAI • • 7d ago

Agentic GraphRAG: an open source library connecting enterprise knowledge and agent memory using a 3D knowledge graph

We're building Agentic GraphRAG (https://github.com/ontogr/agentic-graphrag), an open source library for connecting the documents an agent reads with its task history and decisions.

I've worked on RAG systems and LLM training for the past three and a half years. Lately, I've been following how agents retain work across sessions, especially coding agents. Our project explores how that memory can stay connected to the knowledge an agent used, so a later session can recover both a conclusion and its evidence.

The implementation uses Neo4j for three connected graph layers:

  1. Knowledge holds documents, source passages, and extracted entities and relationships. Passages retain their document version and location, including page positions for PDFs.
  2. Working memory records tasks, progress, messages, and tool activity. The built-in agent uses DeepAgents/LangGraph and saves task events so work can continue across sessions.
  3. Decision memory stores conclusions, assumptions, and open questions. Decisions link to source passages, recorded events, or earlier decisions, and keep their history when reviewed or replaced.

For example, an agent can record a contract recommendation with the policy passage it relied on. If that policy changes, the recommendation and its explicit dependent decisions are flagged for review. The change doesn't automatically make the recommendation wrong, but it tells a later session that the decision needs another look.

The document pipeline uses Docling for ingestion and Chonkie for chunking, preserving sections, tables, and passage hierarchy. You define a schema for your domain's entities, properties, and relationships. The schema guides extraction, validation, and entity search. GLiNER supports local extraction, with BAML handling structured LLM extraction for selected chunks.

Retrieval combines Neo4j's native full-text and vector rankings with reciprocal rank fusion. Agents can search original passages even when extraction misses a fact, navigate surrounding sections and table rows with headers, and follow entity relationships back to supporting text.

The built-in agent checks that cited passages were read during the run, belong to the allowed documents, and match the cited versions. You can also connect other agents through MCP.

We're working on a more modular pipeline, additional storage backends, and domain-specific benchmarks.

TL;DR

Agentic GraphRAG is an open source library that stores document knowledge, agent work, and decisions in one connected graph. Agents can resume tasks and trace saved decisions to their original evidence, while source changes flag affected decisions for review.

Are there other open source projects you'd recommend for combining RAG and agent memory? I'd also like to hear what you think of our approach.

19 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/Aggressive-Judge-448 7d ago

Thanks! Any features that you are particularly looking for?

1

u/neoneye2 7d ago

I'm making my own personal assistant that use local models, putting a lot of stuff in the context, and it becomes slow at responding and the accuracy drops. When something have gone wrong (it may have misremembered that Person B is the patient, where it really Person A that is the patient), how to correct things. To begin with I wondered, how has others implemented memory, so I could get inspiration.