Examples
Real runnable examples from this repo. Start with a live app if you want product behavior fast, then use script-level examples for focused SDK verification.
Prerequisites for live examples
# Orbit API stack up
# (from repo root)
docker compose up --build
# Ollama running locally
# and a root .env file with:
ORBIT_JWT_TOKEN=<your-jwt>
ORBIT_API_BASE_URL=http://localhost:8000
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=llama3.1Cloud route alternative: get ORBIT_API_KEY from Dashboard and set ORBIT_API_BASE_URL to your hosted endpoint.
Live Product Simulations
live_meal_coach_ollamaexamples/live_meal_coach_ollama/Consumer-facing product simulation with two modes: baseline vs orbit memory.
Run
python -m uvicorn examples.live_meal_coach_ollama.app:app --reload --port 8020Verify: Compare response quality and context preview between baseline/orbit modes.
live_chatbot_ollamaexamples/live_chatbot_ollama/Coding tutor with retrieval inspector and memory feedback in browser UI.
Run
python -m uvicorn examples.live_chatbot_ollama.app:app --reload --port 8010Verify: Verify retrieval ordering and feedback loop from the UI.
Direct API (No SDK)
Use these when you want Orbit from Node.js, Go, or custom runtimes without the Python SDK.
const headers = {
Authorization: `Bearer ${process.env.ORBIT_API_KEY}`,
"Content-Type": "application/json",
Accept: "application/json",
};
await fetch(`${process.env.ORBIT_API_BASE_URL}/v1/ingest`, {
method: "POST",
headers,
body: JSON.stringify({
content: "I prefer short debugging checklists.",
event_type: "user_preference",
entity_id: "alice",
}),
});
const retrieve = await fetch(
`${process.env.ORBIT_API_BASE_URL}/v1/retrieve?query=What%20should%20I%20know%20about%20alice?&entity_id=alice&limit=5`,
{ headers },
);nodejs_orbit_api_chatbotexamples/nodejs_orbit_api_chatbot/Complete Node.js browser chatbot that uses Orbit REST endpoints with API key auth (no SDK).
Run
cd examples/nodejs_orbit_api_chatbot && cp .env.example .env && npm install && npm run devVerify: Open localhost:8030 and verify ingest/retrieve/feedback loop with assistant memory ids.
node_fetch.mjsexamples/http_api_clients/node_fetch.mjsSingle-file Node.js direct API integration using fetch.
Run
cd examples/http_api_clients && cp .env.example .env && npm install && npm run node-exampleVerify: Confirms direct API key auth and retrieval payload parsing.
python_http.pyexamples/http_api_clients/python_http.pyPython requests example for teams not using the Orbit SDK.
Run
cd examples/http_api_clients && cp .env.example .env && python -m pip install requests && python python_http.pyVerify: Confirms ingest and retrieve via raw HTTP in Python.
go_http.goexamples/http_api_clients/go_http.goGo net/http example for service-to-service Orbit integration.
Run
cd examples/http_api_clients && cp .env.example .env && go run go_http.goVerify: Confirms Go clients can call Orbit endpoints with API key auth.
Core SDK Scripts
basic_usage.pyexamples/basic_usage.pySmallest possible ingest + retrieve loop using MemoryEngine.
Run
python examples/basic_usage.pyVerify: Confirms SDK wiring and core request flow.
async_usage.pyexamples/async_usage.pyAsync client usage with AsyncMemoryEngine in event-loop apps.
Run
python examples/async_usage.pyVerify: Confirms async ingest/retrieve works cleanly.
batch_operations.pyexamples/batch_operations.pyBatch ingest and batch feedback workflows for higher throughput.
Run
python examples/batch_operations.pyVerify: Confirms ingest_batch + feedback_batch response handling.
feedback_loop.pyexamples/feedback_loop.pySimple positive feedback write after retrieval.
Run
python examples/feedback_loop.pyVerify: Confirms memory_id feedback integration.
personalization_quickstart.pyexamples/personalization_quickstart.pyRepeated-signal + feedback flow to trigger inferred memories.
Run
python examples/personalization_quickstart.pyVerify: Confirms inferred pattern/preference memory surfacing.
Integration Templates
agent_integration.pyexamples/agent_integration.pyFastAPI chatbot pattern with Orbit + OpenAI call flow.
Run
python examples/agent_integration.pyVerify: Use as implementation template (requires provider credentials).
Recommended evaluation order
Run live_meal_coach_ollama first to feel consumer-facing personalization (baseline vs orbit).
Run live_chatbot_ollama to inspect retrieval ordering and memory feedback behavior.
Run nodejs_orbit_api_chatbot to validate direct Orbit API integration with a non-Python app.
Run examples/http_api_clients scripts when checking language-specific raw HTTP integration.
Run personalization_quickstart.py to verify inferred-memory generation from repeated signals.
Run batch_operations.py when validating throughput-oriented integration paths.
Next
Deployment ->