Knowledge
Try document ingestion, cited BM25 retrieval, listing and deletion through four capabilities. The node uses stored text without a model provider, so it runs against a local daemon offline.
Capabilities
| Capability | Kind | Signature | Module | Summary |
|---|---|---|---|---|
ask | traversal | (question: str, top_k: int = 5, kind: Optional[str] = None) -> Answer | examples/python/features/knowledge/agent.py | Ranked passages with citations and an extractive answer; ``kind`` filters on the |
catalog | traversal | () -> dict | examples/python/features/knowledge/agent.py | Scope statistics and every stored document. |
forget | traversal | (doc_id: str) -> dict | examples/python/features/knowledge/agent.py | Delete one document and its index rows. |
ingest | traversal | (documents: List[Dict[str, Any]]) -> dict | examples/python/features/knowledge/agent.py | Write documents atomically. Each item: ``doc_id``, ``title``, ``metadata`` and |
Commands
python -m atfgraph.worker --module examples.python.features.knowledge.agent:app
python -m examples.python.features.knowledge.call
Files
examples/python/features/knowledge/README.mdexamples/python/features/knowledge/__init__.pyexamples/python/features/knowledge/agent.pyexamples/python/features/knowledge/agentnode.yamlexamples/python/features/knowledge/call.pyexamples/python/features/knowledge/fixtures.py
README
Try document ingestion, cited BM25 retrieval, listing and deletion through four capabilities. The node uses stored text without a model provider, so it runs against a local daemon offline.
| Traversal | Surface | Notes |
|---|---|---|
ingest(documents) | Knowledge.put_many | atomic batch; text is chunked server-side (1200 chars, 100 overlap), chunks keeps caller pages and per-chunk metadata |
ask(question, top_k, kind) | Knowledge.search | BM25 hits with doc_id#ordinal citations; kind is an exact-match filter on document metadata; the answer is extractive with [n] markers |
catalog() | Knowledge.stats, Knowledge.documents | scope statistics and a cursor-paginated listing |
forget(doc_id) | Knowledge.delete | tombstones the document and rewrites the index in the same transaction |
Documents use global scope by default. Inside a traversal, knowledge.scope("session") selects its session scope for per-session documents.
python -m atfgraph.worker --module examples.python.features.knowledge.agent:app
python -m examples.python.features.knowledge.call
The driver ingests invented travel-policy fixtures, asks three questions, lists documents, deletes one and shows the resulting ranking change. Scores measure lexical relevance; doc_id#ordinal citations identify chunks. Metadata filters limit which documents a search uses.