Open Source, Z.ai for Startups

DeepContext

Hierarchical memory for AI agents, published on PyPI and used by outside developers.

Author and maintainer. Accepted into the Z.ai for Startups program with this project.

Agents forget. The usual fix is to stuff more text into the context window, which gets expensive and stops working once the history is long enough. DeepContext stores agent memory as a hierarchical concept graph instead of a flat log, so retrieval can walk the graph rather than scan everything.

It is installable with pip install deepcontext, fully async, and covered by 179 tests. It ships as a library first, with a FastAPI service and a React dashboard on top for people who want to run it as infrastructure rather than import it.

Results

Tests
179
Distribution
PyPI
API surface
Fully async

Retrieval model

  • Memories are organised into a hierarchical concept graph rather than a flat list.
  • Breadth-first traversal pulls in related concepts around a hit instead of returning it in isolation.
  • Hybrid retrieval fuses ranked result sets with Reciprocal Rank Fusion, so semantic and keyword matches both contribute.

What ships

  • The Python library, which is the primary interface.
  • A FastAPI service for running it as a shared memory backend.
  • A React dashboard for inspecting what an agent actually remembered.
  • PostgreSQL for persistence.

Adoption

The package is on PyPI and has been picked up by developers outside the project. It is also what got the work into the Z.ai for Startups program, which provides dedicated technical support, priority API access, and early model access.

Stack

Core
PythonasyncioPostgreSQL
Service
FastAPI
Dashboard
ReactTypeScript
Release
PyPIpytest