Metadata-Version: 2.4
Name: cortexgit
Version: 0.1.0
Summary: Persistent memory for LLM agents
Home-page: https://github.com/google-deepmind/cortexgit
Author: Antigravity
Author-email: Antigravity <antigravity@google.com>
License: MIT
Project-URL: Repository, https://github.com/google-deepmind/cortexgit
Project-URL: Issues, https://github.com/google-deepmind/cortexgit/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: psycopg2-binary>=2.9.0
Requires-Dist: asyncpg>=0.28.0
Requires-Dist: pgvector>=0.1.0
Requires-Dist: anthropic>=0.25.0
Requires-Dist: openai>=1.0.0
Requires-Dist: jsonschema>=4.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: aiosqlite>=0.19.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# CortexGit

Persistent memory for LLM agents. Event sourcing + semantic retrieval.

## The Problem

LLM agents are stateless. They forget context between sessions. They can't coordinate without explicit message passing. They have no audit trail.

## The Solution

CortexGit is an in-process memory system. Write events, retrieve context, persist facts. Works with any LLM, any agent framework.

## Installation

```bash
pip install cortexgit
```

## Quick Start

```python
from cortexgit import CortexGit
from anthropic import Anthropic

# Initialize memory (creates local SQLite database)
memory = CortexGit()
client = Anthropic()

def my_agent(user_query):
    # Retrieve relevant context from memory
    context = memory.get_context(
        goal=user_query,
        budget_tokens=4000
    )
    
    # Call Claude with context
    response = client.messages.create(
        model="claude-sonnet-4-20250514",
        system=f"You are a helpful agent. Memory: {context}",
        messages=[{"role": "user", "content": user_query}]
    )
    
    # Remember what happened
    memory.log_event("interaction", {
        "query": user_query,
        "response": response.content[0].text
    })
    
    return response.content[0].text

# Use it
print(my_agent("What is 2+2?"))
```

## Documentation

- [API Reference](docs/API_REFERENCE.md)
- [Architecture](docs/ARCHITECTURE.md)
- [Getting Started](docs/GETTING_STARTED.md)

## Configuration

By default, CortexGit uses SQLite (`sqlite+aiosqlite:///cortexgit.db`) which requires no external server or setup.

To use PostgreSQL in production:
1. Install PostgreSQL and create a database (e.g. `cortexgit`).
2. Set the `DATABASE_URL` environment variable:
   ```bash
   DATABASE_URL="postgresql+asyncpg://postgres:password@localhost:5432/cortexgit"
   ```

## Features

- ✅ Append-only event log (source of truth)
- ✅ Persistent entity registry with conflict detection
- ✅ Automatic snapshot generation
- ✅ Semantic retrieval over compressed memory
- ✅ Works with any LLM (Claude, GPT, local models)
- ✅ Single import, no server needed

## License

MIT
