pip install trevec · works with Claude Code, Cursor, and Codex

The memory layer
for autonomous AI agents.

Persistent memory for your AI apps and coding agents. For code, conversations, documents, or anything. No API key. No cloud. Sub-50ms.
$pip install trevec

Install in 10 seconds. Runs 100% locally.

Works with your favorite AI coding tools

Claude CodeCursorWindsurfZedVS CodeCodexAntigravity
<50msretrieval17languagesZerodata egress$5-26/daysaved in API costs

Compatible with every MCP-capable agent and IDE

The Problem

AI agents are powerful. Their memory is not.

Today’s AI agents lose context between sessions, rely on expensive cloud APIs for memory, and can’t isolate user data. Trevec fixes that.

Without Trevec

Agents forget everything between sessions

Memory solutions require cloud APIs and charge per operation

User data scattered across third-party services

No isolation between users in multi-tenant apps

With Trevec

Persistent memory that survives restarts — zero setup

Zero cost, zero latency — runs locally next to your app

Your data never leaves your server

Built-in multi-user isolation from day one

Universal

One SDK. Every use case.

Use Trevec as an SDK in your AI apps, as an MCP server for your IDE, or both. Same engine, same memory.

Without Trevec
User

My order is missing items again!

AI

I'm sorry about that. Can you provide your order number? I'll look into what happened and process a refund for the missing items.

With Trevec
User

My order is missing items again!

AI

I see this happened before with order #9012 on Mar 10 — the driver only picked up 2 of 3 bags from Siam Kitchen. I've refunded the missing items, added a $10 credit, and flagged this restaurant for packaging issues. Your peanut allergy note is on file for future orders.

How Code Context Works

Three steps to perfect context

For coding agents — Trevec understands your codebase structurally, then delivers context via MCP to any IDE.

01

Parse & Index

A ground-truth map of your system

Trevec parses your entire codebase into a live structural map. Functions, classes, and modules become nodes. Imports, calls, and inheritances become edges. The result is a semantic graph of your application.

02

Search & Retrieve

Ranked by structure and meaning, not just keywords

When agents query your code, Trevec answers with structurally relevant context, combining lexical and semantic signals. Everything happens locally with zero data egress.

03

Expand & Stream

Structurally relevant context delivered via MCP

Trevec returns a compact, structured context bundle that includes the right dependencies and relationship boundaries for the task at hand. Ready for any MCP-capable tool.

See the Structure

Code is a graph, not a pile of text

Trevec builds a live map of every function, class, and connection in your codebase. Your AI gets a structural view, not random text chunks.

auth.rslogin()db.rsUserjwt.rsquery()verify()Sessionconfig.rsmod.rs

Universal Integration

One memory. Every tool.

Trevec acts as the shared context layer across all your AI-powered development tools. Every agent reads from and writes to the same graph.

Python SDK

Build AI apps with persistent memory. Chatbots, tutors, advisors, support agents — any app that needs to remember.

FastAPIDjangoLangChainCrewAI

MCP Server

Give your IDE deep codebase context. Works with any MCP-capable tool — zero configuration.

Claude CodeCursorWindsurfCodex

Autonomous Agents

Feed long-running agents perfect context. CI pipelines, code review bots, and custom agents.

CodexDevinSWE-agentCustom

The Difference

Not another RAG tool

RAG tools treat your code like a document. Trevec treats it like what it is - a graph of interconnected logic.

Traditional RAG

Flat text chunks

Treats code like a PDF. Splits into overlapping windows with no understanding of syntax.

Keyword matching only

Can't follow imports or call chains. Misses the code that actually matters.

Minutes to re-index

Every edit triggers a full re-embed. Your agent works with stale context.

Siloed files

Each file exists in isolation. No understanding of how modules depend on each other.

Requires cloud APIs

Your proprietary code gets shipped to external embedding services to work.

Trevec

Better

AST-aware parsing

Understands functions, classes, and module boundaries natively. Not guessing. Parsing.

Graph-powered retrieval

Traverses imports, calls, and inheritance edges to surface the right context every time.

Millisecond indexing

Only processes changed files. Always current, always fast. No full re-embeds.

Full codebase graph

Every relationship mapped across files. Cross-module context built in from day one.

Zero data egress

Everything runs on your machine. Your code never touches an external server.

75% token savings

Structurally relevant context, not full-file dumps. Saves $5-26/day in API costs.

Hybrid search - full-text + semantic - all on your machine.

Comparison

Not another cloud memory SDK.

Cloud memory solutions add latency, cost, and cloud dependency to every operation. Trevec runs locally — like SQLite for agent memory.

Cloud Memory SDKs
Trevec
Requires API key
Required
Not needed
Data location
Their cloud
Your server
Retrieval latency
200-700ms
<50ms
Cost per operation
$0.01-0.05
$0
Works offline
Multi-user isolation
Varies
Built-in
Code understanding

Real-World Benchmark

One query. 15x fewer tokens.

We asked “How does the planner agent work?” in a 50K LoC codebase. Trevec returned the answer in one call. Traditional tools needed six.

Tool calls needed
Trevec
1
Without
6+
Time to answer
Trevec
~2s
Without
~30s
Tokens consumed
Trevec
~4K
Without
~32K
Files read manually
Trevec
0
Without
5+
0%

fewer tokens per query

0x

faster context retrieval

$0/day

saved on Opus API costs

Benchmark: Claude Sonnet 4.6 in Cursor, querying a 50K LoC production codebase. “How does the planner agent work?”

Infrastructure

The context layer for AI-native development

Trevec isn’t a feature. It’s infrastructure. The foundational memory layer that makes every AI coding tool smarter.

<50ms
P95 retrieval latency
17
Languages supported
75%
Fewer tokens per query
0
External API calls

Agent-native architecture

Built from the ground up for autonomous coding agents, not retrofitted from search tools.

Sub-50ms context delivery

Real-time retrieval that doesn't bottleneck agent execution loops.

Zero vendor lock-in

Open protocol (MCP), local-first engine, deploy anywhere.

Language-agnostic graph

17 languages parsed with tree-sitter. One unified graph for polyglot repos.

Built for Trust

Your code stays yours

Choose your deployment model. Cloud for teams, local for solo developers, or self-host for full control. Your data never touches infrastructure you don’t own.

Cloud platform

Team-wide shared graph with encrypted sync. Enterprise-grade security with SOC 2 Type II in progress. Zero-knowledge architecture. We never see your code.

Zero data egress

Your source code is parsed and indexed locally. Only the graph structure syncs. Never raw files.

Fully local engine

Runs entirely on your machine. Zero network calls. No telemetry. Air-gap compatible.

Complete transparency

Every operation happens on your hardware. No cloud dependency. No data leaves your machine. Full control, always.

100% local engine. Cloud platform encrypted end-to-end. Your data never leaves your machine.

For Teams

Trevec Cloud

Everything in the local engine, plus shared memory and context across your entire team.

Shared context graph

Your whole team's codebase in one semantic graph. Every agent gets the same structural understanding.

Team memory

Debugging sessions, architecture decisions, and reviews persist across the entire team. Not just one engineer's machine.

Encrypted sync

End-to-end encrypted. Zero-knowledge architecture. Your code never touches our servers in plaintext.

Admin controls

SSO, audit logs, role-based access. Enterprise-ready from day one.

Trevec Cloud

Get early access to Trevec Cloud

Shared memory, team-wide context graphs, and encrypted sync for engineering teams. Join the waitlist.

No spam. Unsubscribe anytime.

Frequently asked questions

Can’t find what you’re looking for? Reach out to us

Ready for
infinite context?

Download Trevec and give your AI agents the full picture. Teams can join the Trevec Cloud waitlist for shared memory across your org.

100% local. Zero data egress. Cloud platform coming soon.