A robust, modular, and extensible conversational AI assistant with human-like long-term memory, multimodal (vision) capabilities, and tool integration (e.g., Google Maps). Built with Python, LLMs (Ollama, Gemini), ChromaDB, and modern async speech interfaces.
Key Components:
- main.py: Entry point. Handles the async conversation loop, speech I/O, and interaction with the memory system.
- memory/: Modular memory system.
conversational_memory.py: Manages buffer, summarization, and long-term memory storage/retrieval.llm_summarizer.py: Summarizes conversation into structured facts using LLMs.knowledge_base.py: Handles persistent vector storage (ChromaDB) and embedding via Ollama.pydantic_model.py: Strict Pydantic schemas for context and fact extraction.
- tools/: (Planned) Tool integrations for vision (image-to-Gemini) and Google Maps API.
- speak.py / listen.py: Async macOS TTS and speech recognition for natural voice interaction.
- personality.py: Dynamic system prompt for different AI personalities.
- config.py: Centralized configuration for all tunable parameters.
Data Flow:
- User speaks → audio transcribed → text passed to main loop.
- ConversationManager buffers turns, summarizes with LLM, and stores only high-value facts in ChromaDB.
- On each turn, context is built from recent buffer, summaries, and relevant long-term memory.
- LLM generates a response, which is spoken back to the user.
- (Optional) User can upload images or request map info via tools (planned/extendable).
- Human-like memory: Stores only explicit, important facts; deduplicates and scores for worthiness.
- Multimodal: (Planned) Accepts images, queries Gemini Vision for image understanding.
- Tool Augmentation: (Planned) Google Maps API for location-based queries.
- Speech-enabled: Async TTS and speech recognition for hands-free use.
- Configurable: All parameters in
config.pywith clear explanations. - Testable:
test.pyfor simulating conversations and inspecting memory/context.
pip install -r requirements.txt- Ensure you have Ollama running locally for embeddings and LLM inference.
- (Optional) Set up Gemini API and Google Maps API for tool integrations.
- Edit
config.pyto set model names, buffer sizes, API keys, etc.
python3 main.py- Speak to the assistant; it will respond and build memory over time.
python3 test.py- Runs sample conversations and prints what the system stores as context/summary.
- Place tool scripts in
tools/(e.g., for image upload or map queries). - Extend
main.pyandConversationManagerto call these tools as needed.
main.py— Main async loop, speech I/O, and conversation logicmemory/— All memory, summarization, and vector DB logictools/— (Planned) Tool integrations (vision, maps, etc.)config.py— All configurationtest.py— Test harness for memory/contextchroma_db/— Persistent vector DB storagetranscriptions.txt,conversation_summary.txt,stored_facts.txt— Logs and memory outputs
- Add new tools in
tools/and register them inmain.py. - To add vision: write a tool that takes an image, sends it to Gemini Vision, and returns the result.
- To add maps: write a tool that queries Google Maps API and returns info to the user.
- Update
ConversationManagerto call tools based on user intent.
- Built by Ameer Hamza Khan
- Uses open-source LLMs, ChromaDB, and modern Python async libraries.
MIT License (see LICENSE file)