Agent skill · research science · aiskillstore
recursive-knowledge
Process large document corpora (1000+ docs, millions of tokens) through knowledge graph construction and stateful multi-hop reasoning. Use when (1) User provides a large corpus exceeding context limits, (2) Questions require connections across multiple documents, (3) Multi-hop reasoning needed for complex queries, (4) User wants persistent queryable knowledge from documents. Replaces brute-force document stuffing with intelligent graph traversal.
Why this skill is useful
Adds executable scripts for indexing and querying large document corpora with stateful multi-hop reasoning that the AI cannot generate on its own.
What it needs
Requires python3 installed locally. About 2k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Recursive Knowledge Processing Process arbitrarily large document sets through knowledge graph construction and stateful multi-hop queries. Based on RLM research but with proper state management and termination logic. Core Concept Instead of stuffing documents into context (which causes degradation), this skill: 1. Indexes documents into a knowledge graph (entities, relationships) 2. Answers queries by traversing the graph 3. Tracks state to avoid redundant exploration 4. Uses confidence thresholds to know when to stop Workflow Phase 1: Indexing For a new corpus, run the indexer: This extracts: Entities: People, organizations, concepts, dates, locations Relationships: References, mentions, contradicts, supports, relatesto Metadata: Source document, position, extraction confidence For details on entity/relationship schema, see references/graph-schema.md. Phase 2: Querying For user queries against an indexed corpus: The query engine: 1. Parses query into target entities/relationships 2. Finds entry points in graph 3. Traverses with state tracking 4. Stops when confidence threshold met 5. Returns answer with provenance Phase 3: Incremental Updates Add new documents to existing graph: State Management (Critical) The key improvement over naive recursive approaches is stateful traversal. See references/state-management.md for full details. During query execution, track: State Purpose ------- --------- visitednodes Prevent re-exploring same entities visitededges Prevent re-traversing same relationships findings Accumulated evidence with sources confidence Current certainty level (0-1) depth Current traversal depth Termination conditions: Multi-Hop Reasoning For questions requiring connection across documents: 1. Identify query components (what entities/facts needed) 2. Find entry points for each component 3. Traverse from each entry point 4. Look for path intersections 5. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/recursive-knowledge