Self-Improving Agentic RAG Engine - Evolve multi-agent RAG pipelines using Quality-Diversity optimization
Project description
SIARE - Self-Improving Agentic RAG Engine
Stop tuning RAG pipelines. Let them evolve.
SIARE is the first self-improving RAG engine that treats pipeline configuration as evolvable genetic material. Instead of manually tuning prompts, retrieval strategies, and agent topologies, SIARE uses Quality-Diversity optimization to automatically discover and maintain diverse high-performing multi-agent RAG strategies.
The Problem
Building RAG systems today means endless iteration:
- Tweak prompts → benchmark → repeat
- Try different chunking strategies → benchmark → repeat
- Adjust retrieval parameters → benchmark → repeat
- Add more agents → debug interactions → repeat
This process is expensive, brittle, and never-ending as your data and requirements change.
The Solution
SIARE treats your RAG pipeline as a living system that evolves:
- Define your goals - accuracy, latency, cost, or custom metrics
- Let evolution work - SIARE mutates prompts, tools, and even agent topology
- Get diverse solutions - Quality-Diversity ensures you have multiple good options
- Adapt continuously - As your data changes, your pipeline evolves
Quick Start
pip install siare
# Initialize a new project
siare init
# Run evolution (10 generations)
siare evolve
# Query your evolved pipeline
siare run "How do I reset my password?"
How It Works
┌─────────────────────────────────────────────────────────────────┐
│ SIARE Evolution Loop │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Execute │───▶│ Evaluate │───▶│ Diagnose │───▶│ Mutate │ │
│ │ SOP │ │ Metrics │ │ Weakness │ │ SOP │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ ▲ │ │
│ │ │ │
│ └────────────────────────────────────────────────┘ │
│ │
│ Mutation Types: │
│ • PROMPT_CHANGE - Evolve prompts based on failure patterns │
│ • PARAM_TWEAK - Adjust model parameters (temp, tokens) │
│ • ADD_ROLE - Add new agents to the pipeline │
│ • REMOVE_ROLE - Simplify by removing agents │
│ • REWIRE_GRAPH - Change how agents connect and communicate │
│ • CROSSOVER - Combine successful strategies │
│ │
└─────────────────────────────────────────────────────────────────┘
Key Features
🧬 Topology Evolution
Unlike prompt-only optimizers, SIARE can evolve the structure of your pipeline - adding, removing, and rewiring agents to find optimal architectures.
🎯 Quality-Diversity Optimization
Using MAP-Elites, SIARE maintains a diverse population of high-performing solutions. You don't just get one answer - you get a range of options trading off different metrics.
🤖 Hybrid Agentic Evolution
Three evolution modes to match your needs:
- Single-turn: Fast, cheap mutations via Diagnostician + Architect (default)
- Agentic: Multi-turn variation with tool access — the agent diagnoses, proposes, validates, and iterates
- Adaptive: Starts single-turn, automatically escalates to agentic when stagnation is detected
When evolution stalls, a SupervisorAgent analyzes the trajectory and redirects exploration toward unexplored territory.
🔌 Extensible Hooks
Enterprise features integrate cleanly via hooks without modifying core code:
- Audit logging
- Usage billing
- Approval gates
- Custom metrics
📊 Built-in Benchmarks
Evaluate your pipelines against standard datasets:
- HotpotQA (multi-hop reasoning)
- Natural Questions
- Custom evaluation suites
Installation
# Core package
pip install siare
# With LLM providers
pip install siare[llm]
# With embeddings support
pip install siare[embeddings]
# Everything
pip install siare[full]
Programmatic Usage
from siare import ProcessConfig, Role, GraphEdge
from siare.services import DirectorService, ExecutionEngine, GenePool
# Define your pipeline
config = ProcessConfig(
name="customer-support",
version="1.0.0",
roles=[
Role(
name="retriever",
model="gpt-4o-mini",
system_prompt="Find relevant documents...",
tools=["vector_search"],
),
Role(
name="answerer",
model="gpt-4o-mini",
system_prompt="Answer based on retrieved context...",
),
],
graph=[
GraphEdge(source="retriever", target="answerer"),
],
)
# Run evolution
director = DirectorService(llm_provider)
gene_pool = GenePool()
for generation in range(10):
# Execute and evaluate
trace = await engine.execute(config, task)
evaluation = await evaluator.evaluate(trace)
# Diagnose and mutate
diagnosis = await director.diagnose(evaluation)
mutated = await director.mutate_sop(config, diagnosis)
# Track in gene pool
gene_pool.add(mutated, evaluation)
# Get best solution
best = gene_pool.get_pareto_frontier()[0]
Why SIARE?
| Feature | SIARE | DSPy | AutoRAG | LangChain |
|---|---|---|---|---|
| Prompt optimization | ✅ | ✅ | ✅ | ❌ |
| Parameter tuning | ✅ | ❌ | ✅ | ❌ |
| Topology evolution | ✅ | ❌ | ❌ | ❌ |
| Quality-Diversity | ✅ | ❌ | ❌ | ❌ |
| Agentic variation | ✅ | ❌ | ❌ | ❌ |
| Self-supervision | ✅ | ❌ | ❌ | ❌ |
| Multi-agent support | ✅ | Limited | ❌ | ✅ |
| Extensible hooks | ✅ | ❌ | ❌ | ✅ |
Examples
- Customer Support - Simple Q&A over documents
- Clinical Trials - Complex multi-agent research assistant
Documentation
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
License
MIT License - see LICENSE for details.
Built with ❤️ by Synapti.ai
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 siare-1.2.0.tar.gz.
File metadata
- Download URL: siare-1.2.0.tar.gz
- Upload date:
- Size: 382.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8022fc6448c0485f1ef0aef359360ef1225c1c15a36602125f8a4bbc27f9512
|
|
| MD5 |
369afddc4b0b9f66de3e176174a5d896
|
|
| BLAKE2b-256 |
ac27c13990c22db1798fd3e3527cb7a0b31c8b1eb9edddca145f8fb25be8aef2
|
Provenance
The following attestation bundles were made for siare-1.2.0.tar.gz:
Publisher:
publish.yml on synaptiai/siare
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
siare-1.2.0.tar.gz -
Subject digest:
e8022fc6448c0485f1ef0aef359360ef1225c1c15a36602125f8a4bbc27f9512 - Sigstore transparency entry: 1191330189
- Sigstore integration time:
-
Permalink:
synaptiai/siare@60db8c4186b7efa46b80fa1ec4375e28c9fd5e71 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/synaptiai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@60db8c4186b7efa46b80fa1ec4375e28c9fd5e71 -
Trigger Event:
release
-
Statement type:
File details
Details for the file siare-1.2.0-py3-none-any.whl.
File metadata
- Download URL: siare-1.2.0-py3-none-any.whl
- Upload date:
- Size: 461.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2f7a49286f1412a937cdd1506cbbc2b3ac7e38e947f40563daddd6a37b6d22c
|
|
| MD5 |
a85688d4c336e33da21056f4b408f4e2
|
|
| BLAKE2b-256 |
9ab4bd17289dd3dbcba519d63522b40143c8d10bb1dc75f3ec20087d10ae5b1e
|
Provenance
The following attestation bundles were made for siare-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on synaptiai/siare
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
siare-1.2.0-py3-none-any.whl -
Subject digest:
d2f7a49286f1412a937cdd1506cbbc2b3ac7e38e947f40563daddd6a37b6d22c - Sigstore transparency entry: 1191330194
- Sigstore integration time:
-
Permalink:
synaptiai/siare@60db8c4186b7efa46b80fa1ec4375e28c9fd5e71 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/synaptiai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@60db8c4186b7efa46b80fa1ec4375e28c9fd5e71 -
Trigger Event:
release
-
Statement type: