Intelligent-first memory decision engine for developers
Project description
Orbit
Memory infrastructure for developer-facing AI applications.
Orbit gives your app long-term memory with adaptive personalization, relevance ranking, and feedback learning.
You integrate once, then use the same simple loop everywhere: ingest -> retrieve -> feedback.
Project status: Alpha (0.1.x)
What Orbit Is
Orbit is a memory layer for AI products where context quality matters over time.
Orbit handles:
- event ingestion and durable memory storage
- semantic retrieval with ranking and intent-aware reweighting
- adaptive inferred memories (learning patterns, progress, preferences)
- feedback-driven ranking updates
- provenance metadata for debugging why a memory was surfaced
- API runtime concerns (JWT auth, rate limits, idempotency, observability)
Why Orbit
Without a memory layer, many assistants either forget important user signals or overload prompts with noisy history.
Orbit is built to return small, high-signal context sets that improve answer quality while staying explainable.
Repository Layout
| Path | Purpose |
|---|---|
src/orbit/ |
Public Python SDK (MemoryEngine, AsyncMemoryEngine) |
src/orbit_api/ |
FastAPI runtime (/v1/ingest, /v1/retrieve, /v1/feedback, etc.) |
src/memory_engine/ |
Memory orchestration and adaptive personalization |
src/decision_engine/ |
Core decision/ranking/storage primitives |
examples/ |
Working integration samples |
docs/ |
Deployment, integration, and operational docs |
Quickstart (5 Minutes)
1) Install
Published package:
pip install orbit-memory
Local repository install:
pip install -e .
2) Start Orbit API Locally
Recommended full local stack (API + Postgres + Prometheus + OpenTelemetry collector):
docker compose up --build
3) Generate a Local JWT
python scripts/generate_jwt.py \
--secret orbit-dev-secret-change-me \
--issuer orbit \
--audience orbit-api \
--subject local-dev
4) Integrate with the SDK
from orbit import MemoryEngine
engine = MemoryEngine(
api_key="<jwt-token>",
base_url="http://localhost:8000",
)
engine.ingest(
content="I keep confusing for-loops and while-loops.",
event_type="user_question",
entity_id="alice",
)
retrieval = engine.retrieve(
query="What should I know about alice before answering?",
entity_id="alice",
limit=5,
)
if retrieval.memories:
engine.feedback(
memory_id=retrieval.memories[0].memory_id,
helpful=True,
outcome_value=1.0,
)
5) Optional Direct API Call
curl -X POST http://localhost:8000/v1/ingest \
-H "Authorization: Bearer <jwt-token>" \
-H "Content-Type: application/json" \
-d '{"content":"User completed first lesson","event_type":"learning_progress","entity_id":"alice"}'
Integration Paths
| Mode | Best for | Entry point |
|---|---|---|
| Python SDK | Python apps wanting fastest integration | from orbit import MemoryEngine |
| REST API | Non-Python or service-to-service integration | POST /v1/ingest, GET /v1/retrieve, POST /v1/feedback |
| OpenClaw plugin | Agent workflows in OpenClaw | integrations/openclaw-memory/ |
Core Concepts
| Concept | Description |
|---|---|
entity_id |
Stable identity key for a user, agent, or account |
ingest |
Add a memory signal (user_question, assistant_response, etc.) |
retrieve |
Fetch ranked context memories for a query |
feedback |
Send outcome quality signal (helpful, outcome_value) |
| inferred memory | Auto-generated memory from repeated patterns/feedback |
| inference provenance | why/when/type/derived_from metadata for traceability |
Architecture Overview
- Application sends events to Orbit.
- Orbit processes and stores memories.
- Retrieval ranks candidate memories for each query.
- Feedback updates ranking behavior and personalization state.
- Adaptive engine emits inferred memories when confidence thresholds are met.
High-level flow:
App -> Orbit API/SDK -> Memory Engine -> Storage/Ranker -> Retrieved Context -> App
Configuration
Core settings live in .env.example.
Most important environment variables:
| Area | Variables |
|---|---|
| Storage | MDE_DATABASE_URL, MDE_SQLITE_PATH, MDE_EMBEDDING_DIM |
| Providers | MDE_EMBEDDING_PROVIDER, MDE_SEMANTIC_PROVIDER |
| Auth | ORBIT_JWT_SECRET, ORBIT_JWT_ISSUER, ORBIT_JWT_AUDIENCE, ORBIT_JWT_REQUIRED_SCOPE |
| API runtime | ORBIT_API_HOST, ORBIT_API_PORT, ORBIT_ENV |
| Limits | ORBIT_RATE_LIMIT_EVENTS_PER_DAY, ORBIT_RATE_LIMIT_QUERIES_PER_DAY, ORBIT_RATE_LIMIT_PER_MINUTE |
| Personalization | MDE_ENABLE_ADAPTIVE_PERSONALIZATION and MDE_PERSONALIZATION_* |
| Observability | ORBIT_OTEL_SERVICE_NAME, ORBIT_OTEL_EXPORTER_ENDPOINT |
Provider Adapters
Supported adapter families:
- OpenAI
- Anthropic
- Gemini
- Ollama
- deterministic/context local fallback
Optional extras:
pip install "orbit-memory[anthropic]"
pip install "orbit-memory[gemini]"
pip install "orbit-memory[ollama]"
pip install "orbit-memory[llm-adapters]"
Production Readiness Checklist
- use PostgreSQL (
MDE_DATABASE_URL) instead of SQLite fallback - run schema migrations (
python -m alembic upgrade head) - enforce strict JWT verification (
ORBIT_ENV=production+ non-default secrets) - configure API limits and batch caps
- enable metrics + tracing and scrape
/v1/metrics - set backup/retention policies for primary database
- load-test retrieval quality under long horizons
Monitoring and Operations
Operational endpoints:
GET /v1/healthGET /v1/statusGET /v1/metricsGET /v1/memories(paginated memory inspection)
Response headers include:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-ResetRetry-After(429)X-Idempotency-Replayed(write endpoints)
Examples
- Live Orbit + Ollama chatbot:
examples/live_chatbot_ollama/ - OpenClaw memory plugin scaffold:
integrations/openclaw-memory/ - API + deployment runbook:
docs/DEPLOY_RENDER_VERCEL.md
Evaluation and Quality
Baseline scorecard:
python scripts/run_orbit_eval.py --output-dir eval_reports/latest
Long-horizon personalization soak:
python scripts/soak_personalization.py \
--output-dir soak_reports/latest \
--sqlite-path tmp/orbit_soak.db \
--turns-per-persona 500
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
401 Unauthorized |
invalid/missing JWT or claim mismatch | verify iss, aud, exp, signing secret |
429 Too Many Requests |
rate limit exhausted | respect Retry-After, tune limits |
409 Conflict on writes |
idempotency key reused with different payload | use unique keys per payload |
| weak personalization | unstable entity_id or missing feedback |
keep stable entity mapping and send feedback |
Contributing
Local validation commands:
python -m ruff check src tests
python -m mypy src
python -m pytest -q
python -m pylint src tests scripts --fail-under=9.0
Make targets:
make lint
make type-check
make format-check
make test
make migrate
make run-api
Documentation
- Canonical developer integration guide:
docs/developer_documentation.md - Build and implementation log:
BUILD_AND_SPEC.md - Repo metadata for discovery:
metaData.md
License, Security, Support
- License: add a
LICENSEfile before public OSS distribution. - Security policy: add a
SECURITY.mdfor vulnerability reporting. - Support: use GitHub Issues for bugs, feature requests, and integration questions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file orbit_memory-0.1.0.tar.gz.
File metadata
- Download URL: orbit_memory-0.1.0.tar.gz
- Upload date:
- Size: 76.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab29e745907b9a5e9f5542265e0f711c953b14a030050b8e2abd4902782ff576
|
|
| MD5 |
8c7857fee1196baad551ce5068010bd8
|
|
| BLAKE2b-256 |
bdda726687cedbf04b3ec8612e703ad07393e3e6e7d0afdfe2f98a7d49df831e
|
File details
Details for the file orbit_memory-0.1.0-py3-none-any.whl.
File metadata
- Download URL: orbit_memory-0.1.0-py3-none-any.whl
- Upload date:
- Size: 100.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
627103e4956bdfa629c30d7dd6c924aaa5a74cdb81a3e172feb476966694992f
|
|
| MD5 |
527ca21c4db4dc4afd284dcc68678d43
|
|
| BLAKE2b-256 |
507dac08f1b686f44c960d386a3663241c7af7bf7db81275d776bd167663308d
|