Unified Context Engine
Project description
Unified Context Engine (UCE)
UCE builds a deterministic knowledge graph of a codebase in Neo4j and exposes reasoning tools over that graph. It works across repositories, supports multiple languages, and continuously updates when files change.
This package is pip-installable and CLI-friendly.
What UCE Does
- Ingests source code, schema, requirements, and policies into a Neo4j graph.
- Tracks files, functions, classes, methods, tables, columns, requirements, and policies.
- Provides deterministic impact analysis and risk assessment.
- Keeps the graph up-to-date via a file watcher.
- Exposes reasoning tools through an MCP server.
Supported Languages
UCE uses Tree-sitter and supports:
- Python
- TypeScript
- JavaScript
- Go
- Java
- C
- C++
Prerequisites
- Python 3.10+ (recommended: 3.10 on Windows due to Tree-sitter wheels)
- Neo4j running locally or remotely
Neo4j Setup (Local)
- Install Neo4j Desktop or Neo4j Server.
- Start a database and note the Bolt URI (default:
bolt://localhost:7687). - Set a username and password.
Neo4j Setup (Docker)
docker run --name neo4j-uce -p7474:7474 -p7687:7687 \
-e NEO4J_AUTH=neo4j/testpassword \
neo4j:5
Install
pip install uce-engine
Configure
Create a config.yaml file in any folder (recommended in the repo you want to analyze).
Example:
project_root: ../talkai-main/
languages:
- python
- typescript
- javascript
- go
- java
- c
- cpp
paths:
code:
- src
schema:
- src/db
requirements:
- src/requirements
policies:
- src/policies
ignore:
- .git
- .next
- __pycache__
- node_modules
- venv
- dist
- build
- coverage
- .idea
- .vscode
- ui
- views
- public
- assets
- styles
- css
- scss
- ".log"
aliases:
"@/": src/
neo4j:
uri: bolt://localhost:7687
user: neo4j
password: testpassword
Optional .env (recommended for local development)
UCE can load environment variables from a .env file.
Defaults:
- UCE looks for
.envat the repo root (next toconfig.yaml). - You can override the location with
UCE_DOTENV_PATH.
We include a template at .env.example. Copy it to .env and fill in your values. Do not commit .env (it contains secrets).
Common variables:
NEO4J_URI,NEO4J_USERNAME,NEO4J_PASSWORDLLM_PROVIDER,OPENAI_API_KEYNEO4J_TRANSPORT_MODE,NEO4J_MCP_HTTP_URL
How ignore Works
ignore entries are substring path filters applied to relative file paths. If a file path contains /ui/ or starts with ui/, it will be skipped.
Globs like "*.log" are treated as literal substrings unless you customize the matcher.
Run (CLI)
From anywhere:
uce --config path/to/config.yaml
This will:
- Load configuration
- Connect to Neo4j
- Build or update the graph
- Start the file watcher
- Launch the MCP server
Run End-to-End (LLM Ingestion)
If you want LLM-based requirements/policies ingestion, you also need the Neo4j MCP server running.
- Start Neo4j and ensure credentials are correct.
- Create
.envfrom.env.exampleand set:LLM_PROVIDER,OPENAI_API_KEY(or Anthropic equivalents)NEO4J_TRANSPORT_MODE=httpNEO4J_MCP_HTTP_URL=http://127.0.0.1:8000/mcp/
- In a separate terminal, start the Neo4j MCP server:
python neo4j-mcp/server.py --transport http --server-host 127.0.0.1 --server-port 8000 --server-path /mcp/
- Run UCE:
uce --config path/to/config.yaml
Stdio MCP (optional)
If you prefer stdio, set:
NEO4J_TRANSPORT_MODE=stdio
NEO4J_MCP_COMMAND=.../python -u neo4j-mcp/server.py --transport stdio
Then run uce --config ... without starting the MCP server separately.
Run (Library)
from uce import run_uce
run_uce("path/to/config.yaml")
MCP Tools
UCE exposes reasoning tools via MCP:
impact_analysisexplain_changerisk_assessment
These tools query the graph (no ingestion logic).
What Nodes Are In The Graph
FileFunctionClassMethodTableColumnRequirementPolicy
If you want additional node types (e.g., Dependencies, Endpoints, Services), add them in ingestion and reasoning layers.
Typical Workflow
- Install Neo4j and start it.
- Create
config.yamlpointing to your repo. - Run
uce --config config.yaml. - Query the MCP server or Neo4j to explore the graph.
Troubleshooting
Neo4j auth error
- Verify
neo4j.uri,neo4j.user,neo4j.passwordinconfig.yaml. - Make sure the database is running.
APOC missing (schema ingestion error)
- If you see
There is no procedure with the name apoc.meta.schema, install the APOC plugin. - Neo4j Desktop: open your DB → Plugins → install APOC → restart the DB.
- Docker: set
NEO4J_PLUGINS='["apoc"]'and restart the container.
Tree-sitter parser error on Windows
- Use Python 3.10 in a clean venv.
No schema/requirements/policies detected
- Check
paths.schema,paths.requirements,paths.policiesinconfig.yaml.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uce_engine-0.1.3.tar.gz.
File metadata
- Download URL: uce_engine-0.1.3.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c56c01d2d87283b8e22fcb66009650cd9a35e458f0c6d8417b08dde86e64d66d
|
|
| MD5 |
b721ba1c0d95b0ab865117154bdc0896
|
|
| BLAKE2b-256 |
5ac8e30127a4b8098040adea1a4efad80687ea1e30c093e9c1eaa8f11fdbbe4e
|
File details
Details for the file uce_engine-0.1.3-py3-none-any.whl.
File metadata
- Download URL: uce_engine-0.1.3-py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2e70314adca570b2437575f54daf1155be8efc055c50c62f5e6380e38fd7304
|
|
| MD5 |
628066d552354b6d2066fc84ce9b89fc
|
|
| BLAKE2b-256 |
8a8eaadd9945f7d259f68fd635b1ab1e9bd9d8227596fc944160b7ecb66f5e55
|