A premium, agentic Company Knowledge OS powered by Gemini 3.5 Flash, FAISS Vector Search, and FastAPI / Streamlit.
OrgBrain is an AI-native operational platform designed to ingest unstructured company resources (like policy documents and Slack history), extract executable operational rules, index them semantically for RAG (Retrieval-Augmented Generation), and handle policy updates with human-in-the-loop validation.
- ⚡ Automated Rule Extraction: Analyzes raw Slack logs and policy docs to derive structured, actionable rules.
- 🔍 Semantic Search (FAISS + Gemini): Powered by
gemini-embedding-2for rich, high-dimensionality vector embeddings and FAISS for fast similarity search. - 🤖 Smart Support Agent: Compares baseline Gemini responses against the RAG-enabled OrgBrain skills store to demonstrate context-aware query resolution.
- 🔄 Policy Change Monitoring: Simulates real-time modifications in operational policy (e.g., refunds) and tasks agents with drafting corresponding rule updates.
- 🛡️ Human-in-the-loop Governance: Interactive approval workflow allowing administrators to review, approve, or reject proposed rule changes before they enter production.
graph TD
A[Unstructured Data: Policy Docs & Slack Logs] -->|Ingestion Agent| B[Structuring Agent]
B -->|Generates JSON Rules| C[(SQLite DB)]
B -->|Computes Embeddings| D[(FAISS Vector Index)]
E[Customer Support Query] -->|Support Agent| F[Semantic Query Lookup]
F -->|Retrieve Rules| D
F -->|RAG Processing| G[Gemini 3.5 Flash]
G -->|Contextual Answer| H[User Dashboard]
I[Policy Change Update] -->|Update Agent| J[Draft Rule Changes]
J -->|Pending Verification| K[Manager Dashboard]
K -->|Approve/Reject| C
- LLM & Embeddings: Google Gemini API (
gemini-2.5-flashorgemini-embedding-2) - Vector Engine:
FAISS-CPU(Facebook AI Similarity Search) - Database:
SQLite3(relational rules & log tracking) - Backend API: FastAPI + Uvicorn
- Frontend Interface: Streamlit (responsive, glassmorphism-themed dark mode)
- Python Stack: Pydantic, Python-Dotenv, NumPy, HTTPX
- Python 3.10+
- A Gemini API Key from Google AI Studio.
-
Clone the repository and navigate to the project directory:
cd OrgBrain -
Create a virtual environment and activate it:
python -m venv venv # On Windows (PowerShell): .\venv\Scripts\Activate.ps1 # On Unix/macOS: source venv/bin/activate
-
Install the dependencies:
pip install -r requirements.txt
-
Configure your environment variables. Create a
.envfile in theorgbrainsubdirectory:GEMINI_API_KEY=your_gemini_api_key_here MODEL_ID=gemini-3.5-flash
For convenience, ready-to-run startup scripts are provided at the root of the project.
Execute the PowerShell startup script to launch both the FastAPI backend and Streamlit dashboard concurrently:
.\run_demo.ps1Make the script executable and run it:
chmod +x run_demo.sh
./run_demo.shOnce the backend is active, you can access the interactive Swagger documentation at http://localhost:8000/docs.
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Verify API health and connection status. |
| POST | /ingest |
Scan resources and rebuild SQLite/FAISS databases. |
| POST | /ask |
Resolve support query using standard LLM vs OrgBrain RAG. |
| GET | /skills |
Fetch all active operational rules. |
| GET | /updates |
List all pending policy updates. |
| POST | /updates/approve |
Approve and apply a pending update to active rules. |
| POST | /simulate-change |
Simulate a real-time policy update and trigger drafting agents. |
Built with 💜 using advanced agentic workflows powered by Google DeepMind Antigravity.