Security advisory — Malicious litellm versions 1.82.7 and 1.82.8 were removed from PyPI (potential API key exfiltration). Uninstall them, rotate exposed credentials, and upgrade to a safe release (e.g. 1.82.9+). Run pip show litellm to verify. PyPI · README

Knowledge & RAG

Document intelligence and RAG with AgenticX.

Knowledge & RAG

Near's knowledge panel manages brains: a document brain for knowledge_search, a code brain for code_search. Each brain has its own config, files, and index. Avatars mount zero or more brains.

The Python KnowledgeBase helper below is the library API (agenticx/memory/knowledge_base.py). Studio ingest goes through agenticx/studio/kb/ and LiteParseAdapter. Do not treat them as one object.

Diagram: LiteParse → chunk → embed ≤10 → Chroma; repo index is a second path.

Default vector store for Desktop is Chroma. Switching embedding config usually requires a rebuild. Ingest must show a real percent or phase, and failures must include filename, type, and a traceback summary.


Document Ingestion

python
1from agenticx.knowledge import KnowledgeBase
2
3kb = KnowledgeBase(name="my-docs")
4
5# Add documents
6kb.add_file("report.pdf")
7kb.add_url("https://example.com/article")
8kb.add_text("AgenticX is a multi-agent framework...", source="manual")
9
10# Process (chunk, embed, index)
11kb.build()

Retrieval

python
1# Vector retrieval
2results = kb.search("What are the key features?", top_k=5)
3
4# Hybrid retrieval (vector + BM25)
5results = kb.search("key features", mode="hybrid", top_k=10)
6
7# With reranking
8results = kb.search("key features", mode="hybrid", rerank=True, top_k=5)

GraphRAG

For complex documents with rich relationships, use GraphRAG:

python
1from agenticx.knowledge import GraphKnowledgeBase
2
3gkb = GraphKnowledgeBase(
4 name="research-papers",
5 graph_backend="neo4j", # or "nebula"
6 neo4j_uri="bolt://localhost:7687"
7)
8
9gkb.add_file("research_paper.pdf")
10gkb.build() # Extracts entities and relationships
11
12# Graph-aware retrieval
13results = gkb.search("relationship between agent memory and performance")

Giving a Knowledge Base to an Agent

In Near, mount a document brain and let the model call knowledge_search. There is no KnowledgeBaseTool on the Studio path.

python
1from agenticx import Agent, Task, AgentExecutor
2from agenticx.llms import OpenAIProvider
3
4executor = AgentExecutor(llm_provider=OpenAIProvider(model="gpt-4o"))
5result = executor.run(agent=agent, task=task)

Supported Document Formats

FormatStudio pathLibrary notes
PDF / DOCX / PPTX / imagesLiteParseAdapter (npm i -g @llamaindex/liteparse)Do not feed PDF bytes as raw text
.xlsx / .xlsNeeds local LibreOfficeHidden from the UI list if missing
Markdown / plain textLiteParse or native—

Embeddings

python
1from agenticx.embeddings import OpenAIEmbeddings
2
3embeddings = OpenAIEmbeddings(model="text-embedding-3-small")
4kb = KnowledgeBase(name="my-docs", embeddings=embeddings)

Supported embedding providers: OpenAI, Bailian, SiliconFlow, LiteLLM.


Vector Stores

StoreNotes
FaissLocal, fast, no server required
ChromaLocal or server mode
QdrantProduction-grade, cloud available
MilvusHigh-scale enterprise
PgVectorPostgreSQL extension
PineconeManaged cloud
WeaviateManaged cloud with GraphQL

Desktop knowledge base defaults to Chroma. Extra vector adapters exist in the tree; they are not all wired into the Studio main path.


Multi-brain knowledge

Document brain and code brain

Current tree can isolate and mount a document brain plus a code brain, then optionally search across mounted brains.

  • Document brain: ingest, chunk, embed, retrieve
  • Code brain: hybrid semantic index over one or more codebases
  • Cross-brain search is optional, not a forced merge of every index

See Skills and Long-horizon coding for neighboring v0.5 capabilities.