ReflexioAI/reflexio
Make your agents improve themselves. Reflexio is an AI agent self-improvement harness that enables your AI agents to continuously learn from real user interactions.
Reflexio – AI Agent Self‑Improvement Platform
What it does – Reflexio is a service that sits between an LLM‑powered agent and its users. It records every multi‑turn conversation, watches for user corrections or expert‑provided “ideal” replies, and automatically extracts two kinds of knowledge:
- User profiles – stable facts about a user or their environment (e.g., preferred deployment region = us‑west‑2).
- Playbooks – reusable step‑by‑step procedures derived from successful interaction patterns. Playbooks can be user‑specific or aggregated across many users and then approved for shared use.
By persisting these artifacts, the same agent can retrieve them on future turns, avoiding repeated mistakes and re‑using proven workflows. The system also runs periodic evaluation of agent responses to gauge improvement.
Key Features
| Feature | What you get |
|---|---|
| Profile Generation | Extracts factual user information, versioned (current/pending/archived) and configurable extraction windows. |
| Playbook Extraction & Aggregation | Clusters similar user behaviours, creates LLM‑generated SOP‑style playbooks, and provides an approval workflow before they become shared. |
| Expert Learning | You can publish an expert’s “ideal” response alongside the agent’s reply; Reflexio highlights substantive gaps and turns them into actionable playbooks. |
| Agent Success Evaluation | Randomly samples sessions, runs head‑to‑head comparisons with shadow content, and analyses tool usage to detect failures. |
| Hybrid Search & Retrieval | Vector + full‑text search across profiles and playbooks, optional LLM query‑reformulation, unified parallel queries (~57 ms p50 on a 3k‑row SQLite store). |
| Multi‑Provider LLM Support | Works with OpenAI, Anthropic, Azure, Gemini, MiniMax, DeepSeek, and many others via LiteLLM. |
| CLI & Python SDK | reflexio command‑line for quick publish/search cycles; reflexio.ReflexioClient for programmatic use. |
| Integrations | Native adapters for the OpenClaw agent framework and a drop‑in wrapper for the mem0 memory platform. |
How to Get Started
- Install –
pip install reflexio-ai(or clone the repo for development). The package ships a small set of services (API on 8061, inference on 8069, SQLite storage). Data lives under~/.reflexio. - Run services –
reflexio services start(oruv run reflexio services startfrom source). The API is reachable athttp://localhost:8061and a docs UI athttp://localhost:8062. - Publish a conversation – Use the CLI or SDK to send a multi‑turn chat where the user corrects the assistant. Reflexio will background‑process the data and create a profile/playbook.
- Search – Query the stored knowledge (
reflexio search "deployment region" --user-id alice) or callsession.search(...)from Python to retrieve relevant context for the next agent turn. - Approve playbooks – Aggregated playbooks appear for review; once approved they are added to the shared pool and can be used by any agent.
Architecture at a Glance
Client (CLI / SDK / HTTP) → FastAPI backend
├─ ProfileGenerationService → extractor → storage
├─ PlaybookGenerationService → user extractor → aggregator → storage
├─ EvaluationScheduler → success evaluator → storage
├─ ShadowComparisonWorker → per‑turn judge → storage
└─ UnifiedSearchService → hybrid vector + text search
All services run locally by default, using a bundled MiniLM ONNX model for embeddings and an optional cross‑encoder reranker. SQLite is the default persistence layer; you can point the inference service to a remote embedding endpoint if desired.
Who Might Use It
- Developers of custom LLM agents who need a systematic way to turn user feedback into lasting improvements without retraining the whole model.
- Product teams building internal support bots that must respect organization‑specific policies (e.g., deployment regions, compliance steps).
- Researchers exploring self‑improving agents; Reflexio provides a benchmark (GDPVal) showing up to 81 % fewer planning steps and 72 % fewer tokens on top of an existing self‑learning Hermes agent.
Community & Support
- Discord – https://discord.gg/7fnCxahase
- Hosted SaaS – Reflexio.ai offers a managed version with extra retrieval and RL‑driven continuous improvement.
- Documentation – https://www.reflexio.ai/docs (API reference, integration guides, architecture details).
Bottom line – Reflexio is an open‑source platform that closes the feedback loop for LLM agents, turning real‑world corrections into reusable, searchable knowledge so agents get smarter with every interaction.
Related
- Project
- Project
- Project
- Project