Nous.Agents.KnowledgeBaseAgent (nous v0.16.0)
View SourceKnowledge Base Agent behaviour implementation.
Specializes agents for knowledge base curation: ingesting documents, compiling wiki entries, querying, generating outputs, and maintaining the knowledge base.
Adds KB reasoning tools on top of the standard KB plugin tools:
kb_plan_compilation— Plan which entries to create from documentskb_verify_entry— Cross-check an entry against source documentskb_suggest_links— Suggest links between entrieskb_summarize_topic— Synthesize across multiple entries
Example
agent = Agent.new("openai:gpt-4",
behaviour_module: Nous.Agents.KnowledgeBaseAgent,
plugins: [Nous.Plugins.KnowledgeBase],
deps: %{kb_config: %{store: Nous.KnowledgeBase.Store.ETS, kb_id: "my_kb"}}
)
{:ok, result} = Agent.run(agent, "Ingest this article about GenServers: ...")
{:ok, result} = Agent.run(agent, "What do we know about OTP?")
{:ok, result} = Agent.run(agent, "Generate a report on Elixir patterns")