Understand the project
Project purpose, workspace, Git state and a declared objective. Pick up the thread without starting from scratch.
workspace_contextPROJECT CONTEXT FOR AI AGENTS
Give your agent a map of the project, the task at hand, and the exact code it needs. Less searching. More building.
workspace_contextlocallocate_codelocal24export function verifySession(token) {
25 return token.expiresAt > Date.now();
26}01 / WORKFLOW
From a new session to the right place in your code.
Project purpose, workspace, Git state and a declared objective. Pick up the thread without starting from scratch.
workspace_contextFind files and definitions by name or keyword. Get line evidence and a freshness check before editing.
locate_codeInspect callers and references. Add hybrid retrieval when you need to search by concept.
callers · find_references02 / ARCHITECTURE
System architecture, tool sequence and the developer workflow.
System diagram
MCP connects your agent to local files and SQLite. Embeddings and Qdrant extend the system when you need semantic retrieval.
Drawing diagram…
flowchart TB
accTitle: hnindex system architecture
accDescr: An MCP agent calls a local hnindex server with workspace files and SQLite storage. Semantic retrieval optionally uses embeddings and Qdrant.
agent_client["AI agent / MCP client<br/>Codex · Claude · Cursor"]
subgraph local_workspace["Local workspace"]
hnindex_server["hnindex MCP server<br/>Context · AST · code lookup"]
project_files["Source files<br/>README · Git"]
sqlite_store[("SQLite<br/>FTS · graph · declared tasks")]
project_files -->|Read and check freshness| hnindex_server
hnindex_server <-->|Index and task storage| sqlite_store
end
subgraph semantic_services["Optional semantic retrieval"]
embedding_provider["Embeddings<br/>Ollama local or cloud API"]
qdrant_store[("Qdrant vectors<br/>Local or hosted")]
end
agent_client <-->|MCP / stdio| hnindex_server
hnindex_server -.->|Code chunks and queries| embedding_provider
embedding_provider -.->|Vectors| hnindex_server
hnindex_server <-.->|Store and retrieve vectors| qdrant_storeScroll inside the diagram on smaller screens.
LOCAL FIRST. YOUR CHOICE.
SQLite holds project context, keyword search and the code graph. For semantic retrieval, use local Ollama or your preferred cloud embedding API.
Read the docsCloud embedding providers receive the code chunks you send for embedding.
FROM ZERO TO CONTEXT
Add the MCP server to your editor. Start with an offline code graph, then add semantic search when you need it.
Node 22+ · Graph indexing supports TypeScript and JavaScript · Embeddings are optional for the offline path.
$ npx -y hnindex-cli init --mcp codexRun inside the project. Codex loads project .codex/config.toml for trusted projects only. Optional skill: npx -y hnindex-cli init-skill --target codex
index_code_graph(
path: "/your/project",
project_name: "my-app"
)workspace_context(project_name: "my-app",
task: "Add session expiry")
locate_code(project_name: "my-app",
symbol: "verifySession")02 / FAQ
Workspace context and TypeScript/JavaScript code graph navigation work offline. Semantic and hybrid retrieval need your configured embedding provider and Qdrant.
Workspace context, keyword lookup and the code graph run locally. Ollama can keep embeddings local too. If you choose a cloud provider, the chunks you embed are sent to that provider.
MCP startup instructions and the optional editor skill guide the workflow. The client decides which tools to call. Filesystem search remains useful for code that is missing, excluded or stale.
The agent declares a task through workspace_context. hnindex stores it in SQLite per project and session. Git state provides evidence of changes, not a guess about your intent.