Metadata-Version: 2.4
Name: rivermind
Version: 0.1.0
Summary: Temporal memory layer for LLMs, delivered as an MCP server.
Project-URL: Homepage, https://github.com/rivermind-ai/rivermind
Project-URL: Repository, https://github.com/rivermind-ai/rivermind
Project-URL: Issues, https://github.com/rivermind-ai/rivermind/issues
Author-email: Ragib Ahashan <ahashanragib@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Ragib Ahashan
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: event-sourcing,llm,mcp,memory,temporal
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: apscheduler>=3.10
Requires-Dist: click>=8.1
Requires-Dist: fastapi>=0.115
Requires-Dist: mcp>=1.0
Requires-Dist: pydantic>=2.6
Requires-Dist: structlog>=24.1
Requires-Dist: uvicorn>=0.30
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.30; extra == 'anthropic'
Provides-Extra: dev
Requires-Dist: anthropic>=0.30; extra == 'dev'
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: openai>=1.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Provides-Extra: llm
Requires-Dist: anthropic>=0.30; extra == 'llm'
Requires-Dist: openai>=1.0; extra == 'llm'
Provides-Extra: openai
Requires-Dist: openai>=1.0; extra == 'openai'
Description-Content-Type: text/markdown

# rivermind

[![CI](https://github.com/rivermind-ai/rivermind/actions/workflows/ci.yml/badge.svg)](https://github.com/rivermind-ai/rivermind/actions/workflows/ci.yml)

Rivermind is a temporal memory layer for LLMs. It runs as a local MCP server over SQLite, stores bi-temporal observations (facts, events, reflections), and gives any MCP client cross-session recall without custom retrieval code.

## Install

```bash
git clone https://github.com/rivermind-ai/rivermind.git
cd rivermind
make install
source .venv/bin/activate
```

## Quick start

```bash
rivermind init                 # creates ~/.rivermind/rivermind.db
rivermind serve                # starts http://127.0.0.1:8080 (MCP at /mcp)
./scripts/smoke_claude.sh      # verifies the server is reachable
```

To wire this into Claude Desktop (three minutes from clone to Claude remembering what you told it), see the [Claude Desktop quickstart](./docs/quickstart-claude.md).

## Narrative synthesis (optional)

Narratives require an LLM API key. Without one, `serve` and `reeval` still work: compaction and state rebuild run, synthesis is skipped with a warning.

Get a key from the provider of your choice:

- Anthropic: [console.anthropic.com/settings/keys](https://console.anthropic.com/settings/keys)
- OpenAI: [platform.openai.com/api-keys](https://platform.openai.com/api-keys)

Export it in your shell (default provider is Anthropic; set `RIVERMIND_LLM_PROVIDER=openai` if the key is an OpenAI one):

```bash
export RIVERMIND_API_KEY=sk-ant-...           # or sk-... for OpenAI
export RIVERMIND_LLM_PROVIDER=anthropic       # or "openai" (default: anthropic)
```

To persist it across terminal sessions, append those two lines to `~/.zshrc` (or `~/.bashrc`) and `source` the file. Verify with `echo $RIVERMIND_API_KEY`.

## Commands

All subcommands accept a global `--db PATH` (default `~/.rivermind/rivermind.db`). Run `rivermind --help` for the full tree, or `rivermind <command> --help` for per-command flags.

| Command | Purpose |
|---------|---------|
| `rivermind init` | Create the DB and apply migrations. |
| `rivermind serve [--host] [--port] [--no-reeval]` | Run the FastAPI + MCP server. |
| `rivermind timeline [--start] [--end] [--topic] [--limit] [--json]` | Print observations in a time window. |
| `rivermind state [--subject] [--attribute] [--rebuild] [--json]` | Print state rows, or rebuild the projection. |
| `rivermind reeval` | Run narrative synthesis + compaction + state rebuild for overdue weeks. |
| `rivermind export --out PATH [--format json\|sqlite]` | Dump observations, state, and narratives. |
| `rivermind import --from PATH` | Load a prior rivermind JSON export. |

## Development

```bash
make install
make dev        # run the server against a local dev DB
make test       # pytest
make lint       # ruff check + ruff format --check + mypy
```

## Documentation

- [Claude Desktop quickstart](./docs/quickstart-claude.md) — connect Claude to a local Rivermind server.
- [Architecture](./docs/ARCHITECTURE.md) — system structure, updated as the code is written.

## License

MIT — see [LICENSE](./LICENSE).

## Code of Conduct

This project follows the [Contributor Covenant](./CODE_OF_CONDUCT.md) v2.1.
