agent-knowledge
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OPENCODE_DATA_DIR | No | Override where OpenCode's session DB lives (OpenCode's own env, honored by our adapter) | ~/.local/share/opencode |
| AGENT_KNOWLEDGE_HOST | No | Dashboard bind address (0.0.0.0 exposes it to the network) | 127.0.0.1 |
| AGENT_KNOWLEDGE_PORT | No | Dashboard HTTP/WebSocket port | 3423 |
| AGENT_KNOWLEDGE_GIT_URL | No | Git remote URL (auto-clones if dir missing) | |
| AGENT_KNOWLEDGE_AUTOWAKE | No | Auto-inject a knowledge(action: wakeup) bundle into SessionStart. Set 0 to disable. | 1 |
| AGENT_KNOWLEDGE_DATA_DIR | No | Override the primary host data root. Leave unset in the common case — adapters auto-detect every well-known host root under ~/. | |
| AGENT_KNOWLEDGE_MEMORY_DIR | No | Git-synced knowledge base directory | ~/agent-knowledge |
| AGENT_KNOWLEDGE_AUTO_DISTILL | No | Auto-distill session insights into the knowledge base | true |
| AGENT_KNOWLEDGE_WAKEUP_BUDGET | No | Tokens for the wakeup bundle | 800 |
| AGENT_KNOWLEDGE_GEMINI_API_KEY | No | Gemini embeddings API key (falls back to GEMINI_API_KEY) | |
| AGENT_KNOWLEDGE_INDEX_VERBATIM | No | Index raw session message chunks into the vector store so conversation is retrievable later. Set false to save disk at scale. | true |
| AGENT_KNOWLEDGE_OPENAI_API_KEY | No | OpenAI embeddings API key (falls back to OPENAI_API_KEY) | |
| AGENT_KNOWLEDGE_EMBEDDING_ALPHA | No | TF-IDF vs semantic blend weight (0 = pure semantic, 1 = pure TF-IDF) | 0.3 |
| AGENT_KNOWLEDGE_EMBEDDING_MODEL | No | Override provider default model | |
| AGENT_KNOWLEDGE_PRECOMPACT_NUDGE | No | Before pre-compaction, nudge the agent to save context via knowledge(action: write). 0 disables the nudge; off suppresses both nudge and disk dump. | 1 |
| AGENT_KNOWLEDGE_ANTHROPIC_API_KEY | No | Claude / Voyage embeddings API key (falls back to ANTHROPIC_API_KEY) | |
| AGENT_KNOWLEDGE_EMBEDDING_THREADS | No | ONNX / OMP thread count for the local provider | |
| AGENT_KNOWLEDGE_EMBEDDING_PROVIDER | No | Embedding provider: local | openai | claude | gemini | local |
| AGENT_KNOWLEDGE_FIRSTPROMPT_BUDGET | No | Tokens for first-prompt injection (clamp [100, 8000]) | 600 |
| AGENT_KNOWLEDGE_FIRSTPROMPT_INJECT | No | Run a targeted knowledge_search on the first user prompt and inject top hits. 0 / false / off to disable. | 1 |
| AGENT_KNOWLEDGE_EXTRA_SESSION_ROOTS | No | Extra session directories, comma-separated. Added to whatever auto-detection finds. | |
| AGENT_KNOWLEDGE_FIRSTPROMPT_MAX_HITS | No | Max knowledge hits attached to the first prompt (clamp [1, 20]) | 4 |
| AGENT_KNOWLEDGE_EMBEDDING_IDLE_TIMEOUT | No | Seconds before unloading the local model (0 = keep loaded) | 60 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| knowledgeA | Knowledge base CRUD, sync, and session-start hydration. Actions: "list" (browse entries), "read" (get entry content), "write" (create/update entry, auto git sync), "delete" (remove entry, auto git sync), "sync" (manual git pull + push), "wakeup" (return token-budgeted section-priority context bundle — identity, active_tasks, recent_decisions, known_gotchas, last_session_summary, top_weighted, semantic_fallback — call once at session start). |
| knowledge_searchA | Search across sessions AND knowledge entries. Returns |
| knowledge_sessionA | Session operations: list sessions, get a full conversation, or get a summary. Use action "list" to browse sessions, "get" to retrieve messages, "summary" for a quick overview. |
| knowledge_adminB | Admin operations: view vector store stats, view/update configuration, rebuild embeddings, prune orphan session embeddings, or VACUUM the database. Use action "status" for index stats, "config" to view or update settings, "rebuild_embeddings" to re-embed all knowledge entries (useful when switching providers), "prune_orphans" to delete embeddings for sessions no longer present on disk, "vacuum" to reclaim free pages. |
| knowledge_graphB | Knowledge graph operations with temporal validity and code structure support. Create/remove edges, traverse via directed BFS, bulk-import code graph edges. Relationship types: related_to, supersedes, depends_on, contradicts, specializes, part_of, alternative_to, builds_on, calls, imports, inherits. Code structure types (calls/imports/inherits) are created by knowledge-ingest and use "code:" prefixed node IDs. |
| knowledge_analyzeA | Analysis tools: find duplicates, unconnected entries, most-connected concepts (god nodes), bridge entries, knowledge gaps, zero-result search queries, stale-by-code-activity entries, or generate a compact knowledge brief. Actions: consolidate, reflect, god_nodes, bridges, gaps, brief, search_gaps, stale_by_code_activity. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 6 tools
Each tool targets a distinct functional domain: CRUD operations, cross-source search, session management, admin/maintenance, graph relationships, and analysis/insights. The action-based sub-operations are clearly scoped, and there is no meaningful overlap between tools.
All tool names follow the consistent pattern `knowledge_<verb_noun>` using snake_case throughout. The naming convention is uniform, with descriptive suffixes (search, session, admin, graph, analyze) that clearly differentiate purposes.
Six tools is an ideal count for a knowledge-management server. Each tool encapsulates a distinct set of related operations (CRUD, search, sessions, admin, graph, analysis), providing comprehensive functionality without overwhelming the agent.
The toolset covers the full lifecycle of a knowledge base: creating/reading/updating/deleting entries, searching across sessions and entries, managing session history, performing administrative tasks (embeddings, vacuum), maintaining knowledge graph relationships, and deriving analytical insights. No obvious gaps exist; even advanced features like bulk graph import and orphan pruning are included.