{"id":51718575,"url":"https://github.com/devigned/kd6","last_synced_at":"2026-07-17T06:40:44.180Z","repository":{"id":362355309,"uuid":"1256387733","full_name":"devigned/kd6","owner":"devigned","description":"An open memory service for agentic AI workloads. Multilayered, multi-tenant, and Kubernetes-native. \"We can remember it for your agents.\"","archived":false,"fork":false,"pushed_at":"2026-06-03T21:51:36.000Z","size":293,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-03T22:06:03.377Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devigned.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-01T18:22:08.000Z","updated_at":"2026-06-03T20:07:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/devigned/kd6","commit_stats":null,"previous_names":["devigned/kd6"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/devigned/kd6","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devigned%2Fkd6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devigned%2Fkd6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devigned%2Fkd6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devigned%2Fkd6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devigned","download_url":"https://codeload.github.com/devigned/kd6/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devigned%2Fkd6/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35571461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-17T02:00:06.162Z","response_time":116,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-17T06:40:43.367Z","updated_at":"2026-07-17T06:40:44.165Z","avatar_url":"https://github.com/devigned.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KD6\n\n*We can remember it for your agents.*\n\nKD6 is an open memory service for agentic AI workloads. It gives agents a\nstructured, searchable, multi-tenant place to store and retrieve knowledge\nacross sessions, teams, and projects. Memories are organized into five layers\n(working, episodic, semantic, procedural, archival) and linked through a\nknowledge graph, with full-text search, vector similarity, scoped visibility,\naudit logging, and GDPR compliance built in.\n\nKD6 implements all three conformance levels of the\n[Open Memory Service (OMS) specification](spec/oms-spec.md), a standard\ninterface for agent memory that decouples AI applications from their storage\nbackend.\n\n## Why?\n\nAI agents are stateless by default. Every conversation starts from zero. The\nworkarounds — stuffing context windows, appending to markdown files, writing\nad-hoc JSON — break down as agent systems grow. An agent team working on a\ncodebase for weeks needs real memory: searchable, scoped, layered, and shared\nwhere appropriate.\n\nKD6 provides that. It is a database purpose-built for agent knowledge, exposed\nthrough both a REST API and the Model Context Protocol (MCP).\n\n## Quick Start\n\n```bash\n# Build\ncargo build --release\n\n# Run the HTTP server (creates kd6.db automatically)\ncargo run --release -p kd6-server\n\n# Or run the MCP server (for agent frameworks that speak MCP)\ncargo run --release -p kd6-mcp\n```\n\nStore a memory:\n\n```bash\n# Create a store (names are the primary identifier, not UUIDs)\ncurl -X POST http://localhost:8080/v1/stores \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-Tenant-Id: my-team\" \\\n  -d '{\"name\": \"project-notes\"}'\n\n# Store a memory (use the store name in the URL)\ncurl -X POST http://localhost:8080/v1/stores/project-notes/memories \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-Tenant-Id: my-team\" \\\n  -d '{\n    \"layer\": \"semantic\",\n    \"content\": {\"text\": \"Auth service uses bcrypt with cost 12\"},\n    \"owner_agent_id\": \"code-reviewer\",\n    \"scope\": {},\n    \"tags\": [\"auth\", \"security\"]\n  }'\n```\n\nSearch it back:\n\n```bash\ncurl -X POST http://localhost:8080/v1/stores/project-notes/search \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-Tenant-Id: my-team\" \\\n  -d '{\"query\": \"authentication\", \"keyword\": true}'\n```\n\n## What It Does\n\n### Memory Layers\n\nMemories live in one of five layers, each with different retention\ncharacteristics:\n\n| Layer | Purpose | Example |\n|---|---|---|\n| **Working** | Scratch space for in-flight tasks | \"Currently refactoring the auth module\" |\n| **Episodic** | Records of specific events | \"PR #42 was merged with 3 approvals\" |\n| **Semantic** | Distilled facts and knowledge | \"The API uses JWT with RS256 signing\" |\n| **Procedural** | Learned processes and patterns | \"Deploy sequence: build, test, stage, promote\" |\n| **Archival** | Historical record | \"Q1 2025 architecture review decisions\" |\n\n### Search\n\nTwo search modes, both available through a single endpoint:\n\n- **Keyword search** powered by SQLite FTS5 with relevance ranking\n- **Vector search** using cosine similarity over stored embeddings\n\nEmbeddings are computed automatically on write and query when an embedding\nprovider is configured (local or OpenAI-compatible).\n\n### Knowledge Graph\n\nLink memories with typed, weighted edges and traverse relationships using\nbreadth-first search. Build graphs like \"this decision depends on that\nrequirement, which relates to this design doc.\"\n\n### Multi-Tenancy and Scoping\n\nHard tenant isolation on every query. Within a tenant, memories are scoped\nacross eight hierarchical levels:\n\n```\ntenant \u003e org \u003e team \u003e project \u003e user \u003e agent \u003e session \u003e run\n```\n\nAn agent only sees memories at its scope level or broader.\n\n### Compliance\n\n- **Audit logging** with SHA-256 hash chain for tamper detection\n- **GDPR purge** removes data and anonymizes audit entries in one transaction\n- **Data sovereignty** configuration per store\n- **Optimistic concurrency** prevents lost updates\n- **Immutable memories** for records that must never change\n\n### MCP Integration\n\nTen tools exposed over the Model Context Protocol for direct agent use:\n\n`create_store`, `list_stores`, `create_memory`, `get_memory`,\n`search_memories`, `delete_memory`, `create_edge`, `traverse_graph`,\n`store_stats`, `gdpr_purge`\n\n## Architecture\n\nFive Rust crates in a Cargo workspace:\n\n```\nkd6-server (HTTP API)     kd6-mcp (MCP server)\n         \\                      /\n          \\                    /\n           kd6-sqlite (backend)\n                  |\n             kd6-core (domain types + SPI trait)\n                  |\n             kd6-embed (embedding providers)\n```\n\n**kd6-core** defines the `OmsProvider` trait (the SPI) and all domain types.\nNo I/O, no dependencies on storage or transport. Any backend implements this\ntrait.\n\n**kd6-embed** provides pluggable embedding providers: a local provider using\nfastembed-rs (all-MiniLM-L6-v2, 384 dimensions) and an OpenAI-compatible HTTP\nprovider for hosted models.\n\n**kd6-sqlite** implements `OmsProvider` using sqlx with async connection\npooling, WAL mode, FTS5, and six migration files. The implementation is split\nacross ten focused modules.\n\n**kd6-server** wraps the provider in an axum HTTP API with 30 routes,\ncustom extractors for JSON error responses, and tenant header validation.\n\n**kd6-mcp** wraps the provider in an MCP server using the rmcp crate,\nexposing ten tools over Streamable HTTP (default) or stdio.\n\nSwapping the backend (to Postgres, DynamoDB, or anything else) means\nimplementing the `OmsProvider` trait. The HTTP and MCP servers work unchanged.\n\n## Configuration\n\n| Variable | Default | Description |\n|---|---|---|\n| `KD6_DATABASE_URL` | `sqlite:kd6.db?mode=rwc` | SQLite connection string |\n| `LISTEN_ADDR` | `0.0.0.0:8080` | HTTP server bind address |\n| `KD6_MCP_TRANSPORT` | `http` | MCP transport: `http` or `stdio` |\n| `KD6_MCP_ADDR` | `0.0.0.0:8081` | MCP HTTP server bind address |\n| `KD6_EMBEDDING_PROVIDER` | `local` | Embedding provider: `local`, `openai-compatible`, or `none` |\n| `KD6_EMBEDDING_ENDPOINT` | — | API endpoint (required for `openai-compatible`) |\n| `KD6_EMBEDDING_MODEL` | — | Model name (required for `openai-compatible`) |\n| `KD6_EMBEDDING_API_KEY` | — | API key (optional, for authenticated endpoints) |\n| `KD6_EMBEDDING_DIMENSIONS` | — | Override embedding dimensions (optional) |\n| `RUST_LOG` | `info` | Tracing log level |\n\n## OMS Conformance\n\nKD6 implements all three OMS specification levels:\n\n| Level | Name | Features | Status |\n|---|---|---|---|\n| 1 | Core | Stores, memories, search, tenant isolation | ✅ Complete |\n| 2 | Standard | Audit, TTL, batching, scoping, inheritance, shared spaces | ✅ Complete |\n| 3 | Advanced | Graph memory, temporal metadata, GDPR, crypto audit, sovereignty | ✅ Complete |\n\n166 tests across five crates. Zero clippy warnings.\n\n## Documentation\n\nDetailed documentation lives in the [`docs/`](docs/) directory:\n\n- **[Architecture](docs/architecture.md)** — crate structure, data flow,\n  design decisions\n- **[Usage Guide](docs/usage.md)** — building, running, API walkthrough with\n  curl examples\n- **[Features](docs/features.md)** — complete reference for all capabilities\n- **[OMS Specification](docs/specification.md)** — the spec, conformance\n  levels, and memory model\n- **[Contributing](docs/contributing.md)** — development workflow, testing,\n  and coding conventions\n\n## Examples\n\nThe [`examples/`](examples/) directory contains integration examples:\n\n- **[squad-memory](examples/squad-memory/)** — Multi-agent sprint simulation\n  using [Squad](https://github.com/bradygaster/squad) with KD6 as the memory\n  provider. Demonstrates memory layers, scoped visibility, knowledge graph,\n  and cross-session recall across three simulated development sessions.\n\n## Development\n\n```bash\n# Full CI pipeline (same as GitHub Actions)\nmake ci\n\n# Individual steps\ncargo fmt -- --check                 # Format check\ncargo clippy --all-targets -- -D warnings  # Lint (zero warnings policy)\ncargo build --all-targets            # Build\ncargo test                           # Run all 166 tests\n```\n\nTests use in-memory SQLite and need no external setup.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevigned%2Fkd6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevigned%2Fkd6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevigned%2Fkd6/lists"}