Context Intelligence

Agentic knowledge
with precise context

UGENT processes documents, codebases, files, and enterprise knowledge into an indexed, graph-aware context layer. Agents retrieve only the evidence they need, reason over relationships, cite the exact source, and act through scoped tools.

Architecture

Two-Plane Architecture

The ingestion plane keeps indexes fresh. The retrieval plane serves low-latency, read-only context to agents and MCP-compatible AI hosts.

UGENT Context Intelligence two-plane architecture diagram
How It Works

From raw files to cited answers

UGENT separates knowledge processing from model reasoning — so the LLM gets only what it needs, with full traceability.

1

Intake & Filtering

Accept source repositories, Markdown, config files, tables, and converted enterprise documents. Filter out binaries, archives, and unsafe paths. Respect repository ignore rules and .ugentignore.

gitignore policy incremental
2

Structure-Aware Chunking

Source code uses AST-aware chunking so functions, classes, and symbols stay intact. Markdown uses heading-aware chunks. Tables carry headers into every chunk. No arbitrary character-window splits.

AST heading-aware row-aware
3

Hybrid Indexing

Dense vector search for semantic similarity. Lexical BM25 for exact identifiers, error messages, and domain terms. Knowledge graph for dependencies, imports, calls, and architecture. All channels fused into one ranked result set.

vector BM25 graph
4

Knowledge Graph

Extracts deterministic relationships without sending source code to an LLM: file-contains-symbol, imports, function calls, type implementations. Semantic edges are cached by file hash and retried through a durable backlog.

deterministic cached durable
5

Pre-LLM Context Bundle

Before calling the LLM, UGENT classifies the request and fetches a compact context bundle: relevant snippets, file paths, line ranges, symbols, citation markers, and token-count estimates — all under a strict budget.

token-budget citations CODE_CONTEXT
6

Agentic Retrieval Loop

Search, inspect graph neighbors, read exact line ranges, use LSP tools for definitions and diagnostics, delegate to scoped sub-agents, then synthesize the final answer — only after collecting enough evidence.

LSP MCP sub-agents
Ingestion

Fast and slow ingestion queues

The fast path makes files searchable immediately. The slow path enriches the graph asynchronously — without blocking availability.

UGENT ingestion pipeline with fast and slow queues
Retrieval

Hybrid retrieval with agentic loop

Vector search, lexical matching, and graph traversal run in parallel. Results are fused, reranked, and packed into a token-budgeted context bundle before the LLM reasons. If more detail is needed, agentic tools drill deeper.

UGENT hybrid retrieval pipeline with agentic loop
Accuracy & Trust

Why UGENT is more accurate

Multiple retrieval signals, deterministic citations, role-scoped agents, and security gates — layered controls that keep answers grounded in evidence.

Hybrid Retrieval

Semantic similarity + exact keyword matching + graph relationships. No single retrieval mode can miss what another catches.

Deterministic Citations

Every answer carries file paths, line ranges, and symbol references. A citation verification endpoint can detect fabricated references.

Knowledge Graph Tools

graph_search, graph_neighbors, and graph_stats expose dependency chains, call hierarchies, and architectural neighborhoods that chunk retrieval cannot see.

Security & Governance

Role-scoped sub-agents, rate limits, duplicate-call detection, trusted authorization gates, and audit-safe idempotent ingestion.

Token Efficiency

Why UGENT uses fewer tokens

Context is selected before the LLM call. The model receives a compact bundle instead of a full repository or document history.

Meaningful Chunks

AST, heading, and row-aware chunks keep relevant units intact. Not too little, not too much.

Graph, Not Files

Graph tools return relationships and node IDs, not entire files. The agent reads only when necessary.

Distilled LSP Output

Language-server information is returned as compact pointers and summaries, not raw verbose protocol payloads.

Cacheable Prompts

Stable system prompt content stays separate from per-turn values, improving prompt-cache reuse across turns.

Scoped Sub-Agents

Delegated workers receive only the tools and context needed for their role. A researcher does not inherit broad write tools.

Budget-Gated Output

Tool output is budget-gated. Large results are summarized before persistence and compressed in the current turn when needed.

MCP Tools

Context intelligence via MCP

UGENT exposes context intelligence through MCP tools for itself and other AI hosts. Auto-detects workspace identity and injects codebase identifiers so the LLM does not need to manage them.

codebase_search

Hybrid code and document search with snippet, structure, and synthesis modes.

graph_search

Find code entities by name. Returns graph node IDs for chaining into graph_neighbors.

graph_neighbors

Explore callers, callees, imports, containers, and references around any node.

graph_stats

Graph health check: total nodes, edges, breakdown by entity kind and relationship type.

graph_list_codebases

List all indexed codebases with node and edge counts. Discover available codebase IDs.

LSP tools

Definition, references, diagnostics, hover, and document symbols — distilled as compact pointers, not raw payloads.

Bring your codebase into UGENT

Ask complex questions, get grounded answers, and let scoped agents act with the right context instead of an overloaded prompt.