Nous.Agents.KnowledgeBaseAgent (nous v0.16.2)

View Source

Knowledge 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 documents
  • kb_verify_entry — Cross-check an entry against source documents
  • kb_suggest_links — Suggest links between entries
  • kb_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")