Spaces:
Sleeping
Sleeping
| title: Second Brain AI Assistant | |
| emoji: 🧠 | |
| colorFrom: blue | |
| colorTo: purple | |
| sdk: gradio | |
| sdk_version: "5.12.0" | |
| app_file: app.py | |
| pinned: false | |
| license: mit | |
| # Second Brain AI Assistant | |
| A production-ready AI assistant that can answer questions about your documents using RAG (Retrieval-Augmented Generation). | |
| ## Features | |
| - **Document Q&A**: Ask questions about your documents | |
| - **Source Attribution**: See which documents were used for each answer | |
| - **Clean UI**: Professional interface with proper formatting | |
| - **Real-time Processing**: Get answers instantly | |
| - **Tool Usage Display**: See which tools were used to generate responses | |
| ## Usage | |
| 1. Enter your question in the text box | |
| 2. Click "Ask" to get an AI-powered answer | |
| 3. View sources and tools used in the response | |
| 4. Use the debug section to see raw responses | |
| ## Example Queries | |
| - "What pricing objections have been raised?" | |
| - "What messaging is resonating with prospects?" | |
| - "What concerns have prospects raised with regards to product?" | |
| - "What has resonated with prospects based on the meeting transcripts?" | |
| ## Configuration | |
| This space uses the following environment variables: | |
| - `OPENAI_API_KEY`: Your OpenAI API key | |
| - `MONGODB_URI`: MongoDB connection string | |
| - `MONGODB_DATABASE_NAME`: Database name (default: second_brain_course) | |
| - `MONGODB_COLLECTION_NAME`: Collection name (default: rag) | |
| - `COMET_API_KEY`: Comet ML API key for tracking | |
| - `COMET_PROJECT`: Project name (default: second_brain_course) | |
| - `RETRIEVER_CONFIG_PATH`: Path to retriever config (default: configs/compute_rag_vector_index_openai_contextual_simple.yaml) | |
| ## Architecture | |
| - **RAG Pipeline**: Uses MongoDB for document storage and retrieval | |
| - **Embeddings**: OpenAI text-embedding-3-small for document embeddings | |
| - **LLM**: GPT-4o-mini for response generation | |
| - **UI**: Custom Gradio interface with enhanced formatting | |
| - **Tools**: MongoDB retriever and final answer tools | |
| ## Local Development | |
| ```bash | |
| # Install dependencies | |
| uv sync | |
| # Run the agent | |
| make run_agent_app | |
| # Or run directly | |
| python app.py | |
| ``` | |
| ## License | |
| MIT License | |