/\ ATFGraph /docs
README Downloads
Examples / ATFGraph
Framework reference

This article is retained from the existing framework docs. Self-hosting commands and server-admin access differ from the managed CLI workflow. Start with Get started for the installed product.

Knowledge

Directory examples/python/features/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.

Agent node label knowledge_desk, version 1.0.0.

Capabilities

CapabilityKindSignatureModuleSummary
asktraversal(question: str, top_k: int = 5, kind: Optional[str] = None) -> Answerexamples/python/features/knowledge/agent.pyRanked passages with citations and an extractive answer; ``kind`` filters on the
catalogtraversal() -> dictexamples/python/features/knowledge/agent.pyScope statistics and every stored document.
forgettraversal(doc_id: str) -> dictexamples/python/features/knowledge/agent.pyDelete one document and its index rows.
ingesttraversal(documents: List[Dict[str, Any]]) -> dictexamples/python/features/knowledge/agent.pyWrite documents atomically. Each item: ``doc_id``, ``title``, ``metadata`` and

Commands

Taken from this example's own README and module docstrings.

python -m atfgraph.worker --module examples.python.features.knowledge.agent:app
python -m examples.python.features.knowledge.call

Files

  • examples/python/features/knowledge/README.md
  • examples/python/features/knowledge/__init__.py
  • examples/python/features/knowledge/agent.py
  • examples/python/features/knowledge/agentnode.yaml
  • examples/python/features/knowledge/call.py
  • examples/python/features/knowledge/fixtures.py

README

Rendered from examples/python/features/knowledge/README.md; the source file is not modified.

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.

TraversalSurfaceNotes
ingest(documents)Knowledge.put_manyatomic batch; text is chunked server-side (1200 chars, 100 overlap), chunks keeps caller pages and per-chunk metadata
ask(question, top_k, kind)Knowledge.searchBM25 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.documentsscope statistics and a cursor-paginated listing
forget(doc_id)Knowledge.deletetombstones 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.

ATFGraph documentationHosted workflow · Framework reference