BCI (Behavior-Conditioned Inference) in Amprealize
What It Is
BCI is Amprealize's implementation of RAG for procedural knowledge. Instead of retrieving documents, it retrieves behaviors — proven step-by-step strategies that condition the agent's execution.
How It Maps to Concepts
| AI/ML Concept | Amprealize Implementation |
|---|---|
| Embeddings | behavior_retriever.py embeds behavior descriptions via sentence-transformers |
| FAISS | In-process FAISS index stores behavior vectors for fast similarity search |
| RAG | Query → retrieve top-k behaviors → inject into prompt → generate |
| Hybrid Retrieval | advanced_retrieval_service.py combines FAISS vector search with keyword filtering |
The Flow
Agent receives task
↓
behaviors.getForTask(task_description, role)
↓
[1] Embed task description → query vector
↓
[2] FAISS search → top-k behavior candidates
↓
[3] Filter by role (Student/Teacher/Strategist)
↓
[4] Score and rank by relevance
↓
[5] Return behavior set → injected into agent context
↓
Agent executes with behavior conditioningKey Files
amprealize/bci_service.py— Core BCI orchestrationamprealize/behavior_retriever.py— Embedding + FAISS retrievalamprealize/advanced_retrieval_service.py— Hybrid retrieval with re-rankingamprealize/context_composer.py— Assembles behaviors into prompts
Why BCI Over Fine-Tuning
| Approach | Pros | Cons |
|---|---|---|
| BCI (RAG) | Instant updates, no training cost, auditable | Depends on retrieval quality |
| Fine-tuning | Baked into model weights | Expensive, slow to update, opaque |
Amprealize chose BCI because behaviors change frequently (new patterns discovered weekly) and auditability matters (every behavior citation is traceable).