Expand description
klieo-memory-graph-rag — graph-first RAG composer.
Stable at 1.x. Trait freeze contract recorded in ADR-039
(docs/adr/adr-039-graphrag-1-0-promotion.md).
Public surface:
BuiltinExtractor,FallbackExtractor,LlmEntityExtractorProvenanceKnowledgeGraph— wraps anyKnowledgeGraphwith aProvenanceRepositoryso everyindex()mints a v2 chain entry and everyrecall_paths()attaches the entry per hop (ADR-038).VerbalizationPipeline— LLM-driven prose summary of aRetrievalPathunder aklieo-specQualityLoop.RegulationIngestTool—ImportSourcefor structured regulatory texts (DORA, AI-Act) — pre-seeds typedArticle/Obligation/Deadlineentity hints.GraphAwareLongTerm— drop-inLongTermMemorythat issues graph-first recall with vector fallback;recall_tracedexposes the same authoritative facts plus aRecallTraceof extracted entities and graph paths for “why did retrieval return this?”KnowledgeIngestionPipeline+ImportSourceextension pointInMemoryFilterableLongTerm— zero-infraFilterableLongTermMemorywith real cosine similarity over an injectedEmbedder
§Quickstart
let long_term = GraphAwareLongTerm::builder().build(vector, graph);GraphAwareLongTerm::builder defaults the extractor
(BuiltinExtractor) and the klieo_memory_graph::RecallMetrics
counter so callers only supply the two mandatory backends. Override
either via GraphAwareLongTermBuilder::extractor /
GraphAwareLongTermBuilder::metrics /
GraphAwareLongTermBuilder::min_graph_hits.
Re-exports§
pub use extractor::BuiltinExtractor;pub use fallback_extractor::FallbackExtractor;pub use graph_aware::GraphAwareLongTerm;pub use graph_aware::GraphAwareLongTermBuilder;pub use graph_aware::RecallTrace;pub use import::ImportDocument;pub use import::ImportError;pub use import::ImportSource;pub use import::KnowledgeIngestionPipeline;pub use in_memory_vector::InMemoryFilterableLongTerm;pub use llm_extractor::LlmEntityExtractor;pub use metadata::KEY_ENTITIES;pub use metadata::KEY_IMPORT_SOURCE_ID;pub use metadata::KEY_TITLE;pub use metadata::KEY_VALID_FROM;pub use metadata::RESERVED_METADATA_KEYS;pub use path_rag::LlmRefiner;pub use path_rag::VerbalizationCritic;pub use path_rag::VerbalizationPipeline;pub use path_rag::DEFAULT_MAX_ITERATIONS;pub use provenance::ProvenanceKnowledgeGraph;pub use provenance::DEFAULT_FACT_INDEX_CAPACITY;pub use provenance::FORGET_EVENT_LABEL;pub use regulation::RegulationDocument;pub use regulation::RegulationIngestTool;
Modules§
- extractor
- Regex-driven entity recogniser and (future) extractor combinators.
BuiltinExtractor— regex-driven entity recogniser for known typed formats, merged with caller-supplied hints. - fallback_
extractor - Two-stage extractor combinator: secondary runs only when primary is empty.
FallbackExtractor— chains primary → secondaryEntityExtractors. Secondary runs only when primary returns an emptyVec(not on error). - graph_
aware GraphAwareLongTerm— graph-first RAG composer over vector + graph.GraphAwareLongTerm— drop-inLongTermMemorythat issues graph-first recall with vector fallback.- import
KnowledgeIngestionPipeline+ImportSource— bulk-ingest extension point.KnowledgeIngestionPipeline+ImportSource— bulk-import external documents into aLongTermMemory.- in_
memory_ vector - In-memory [
FilterableLongTermMemory] with real cosine similarity. In-memory [FilterableLongTermMemory] with real cosine similarity. - llm_
extractor - LLM-backed entity extractor — JSON-array prompt with hint-fallback.
LlmEntityExtractor— recall-extensionEntityExtractorthat uses an LLM to recognise entities in free-form text. - metadata
- Shared reserved metadata-key constants for the ingest/recall contract.
Shared reserved metadata-key constants —
KnowledgeIngestionPipelineWRITES these;GraphAwareLongTermREADS them. Centralised so the writer-vs-reader contract is a single dedupe key. - path_
rag VerbalizationPipeline— LLM-driven verbalisation of aRetrievalPathunder aklieo-specQualityLoop.VerbalizationPipeline— LLM-driven prose summary of aklieo_memory_graph::RetrievalPathunder aklieo_spec::QualityLooprefinement budget.- provenance
ProvenanceKnowledgeGraph— wraps aKnowledgeGraphwith aklieo-provenancechain bridge (see ADR-038).ProvenanceKnowledgeGraph— wraps anyklieo_memory_graph::KnowledgeGraphwith aklieo_provenance::ProvenanceRepositoryso every successfulindex()mints a signedklieo_provenance::ChainEntryand everyrecall_paths()attaches the matching entry perklieo_memory_graph::PathHop.- regulation
- Regulatory-text ingest source — DORA / AI-Act and friends.
RegulationIngestTool—ImportSourcefor structured regulatory texts (DORA, AI-Act, …).