Built with LangGraph, LangChain, and Cohere
Features โข Architecture โข Installation โข Usage โข Roadmap
SYNAPSE is a graph-based AI assistant that combines the power of LangGraph orchestration, tool-aware reasoning, and conversational memory into a sleek Streamlit interface. Built for developers who want to create intelligent, context-aware chatbots with minimal friction.
- ๐ฏ Modular Design โ Easy to extend with new tools and capabilities
- ๐ Graph-Based Reasoning โ Sophisticated agent orchestration using LangGraph
- ๐พ Conversational Memory โ Maintains context across multi-turn conversations
- โก Real-Time Streaming โ Token-by-token response generation
- ๐ ๏ธ Tool Integration โ Web search, stock prices, and custom tools
- ๐จ Clean UI โ Professional Streamlit interface with session management
|
|
|
|
SYNAPSE follows a clean, modular architecture that separates concerns for maximum flexibility:
graph TB
A[Streamlit Frontend] -->|User Input| B[LangGraph StateGraph]
B -->|Process| C[ChatCohere LLM]
C -->|Decision| D{Tool Needed?}
D -->|Yes| E[ToolNode]
D -->|No| F[Direct Response]
E -->|Execute| G[Tool Functions]
G -->|Results| C
C -->|Stream| A
B ---|Memory| H[(Checkpoint Store)]
style A fill:#ff6b6b
style B fill:#4ecdc4
style C fill:#45b7d1
style E fill:#96ceb4
style H fill:#ffeaa7
| Component | File | Responsibility |
|---|---|---|
| Backend | Backend.py |
LangGraph state management, LLM orchestration, tool routing |
| Frontend | Frontend.py |
Streamlit UI, conversation management, streaming display |
| Tools | Tools.py |
Tool definitions, web search, stock prices, custom functions |
synapse-ai/
โ
โโโ ๐ Backend.py # Core agent logic & graph orchestration
โโโ ๐จ Frontend.py # Streamlit chat interface
โโโ ๐ ๏ธ Tools.py # Tool definitions & implementations
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐ .env.example # Environment variable template
โโโ ๐ README.md # Project documentation
- Python 3.8+
- Cohere API Key (Get one here)
git clone https://github.com/Nabin68/SYNAPSE.git
cd SYNAPSEpip install -r requirements.txtRequired packages:
langchain
langchain-cohere
langgraph
streamlit
python-dotenv
duckduckgo-search
yfinanceCreate a .env file in the project root:
COHERE_API_KEY=your_cohere_api_key_here๐ก Tip: Copy
.env.exampleto.envand fill in your API key
streamlit run Frontend.pyThe application will open in your default browser at http://localhost:8501
- Start Chatting โ Type your message in the input box
- Watch Live Responses โ See the AI respond in real-time with streaming
- Switch Conversations โ Use the sidebar to create or switch between threads
- Tool Usage โ The AI automatically uses tools when needed (search, stock prices, etc.)
User: What's the current price of Apple stock?
๐ง SYNAPSE: [Uses stock price tool]
The current price of AAPL is $195.83...
User: Search for the latest AI news
๐ง SYNAPSE: [Uses web search tool]
Here are the latest developments in AI...
Create a new tool in Tools.py:
@tool
def my_custom_tool(query: str) -> str:
"""Description of what your tool does"""
# Your implementation
return resultRegister it in the tool list:
tools = [web_search, stock_price, my_custom_tool]Modify Backend.py to use a different model or provider:
from langchain_openai import ChatOpenAI
model = ChatOpenAI(model="gpt-4", temperature=0.7)- ๐พ SQLite-based persistent memory โ Long-term conversation storage
- ๐ RAG integration โ Document Q&A and knowledge retrieval
- ๐ MCP server support โ Model Context Protocol integration
- ๐งฐ Extended tool library โ Weather, news, calculations, and more
- ๐จ Theme customization โ Dark mode and custom color schemes
- ๐ Analytics dashboard โ Conversation insights and usage stats
- ๐ Multi-language support โ Internationalization
- ๐ Authentication โ User accounts and access control
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PEP 8 style guidelines
- Add docstrings to new functions
- Update README for new features
- Test thoroughly before submitting
This project is licensed under the MIT License - see the LICENSE file for details.
Nabin
- GitHub: @Nabin68
- LinkedIn: Nabin Rouniyar
- LangChain โ For the incredible LLM framework
- LangGraph โ For graph-based agent orchestration
- Cohere โ For powerful language models
- Streamlit โ For the beautiful UI framework
If you encounter any issues or have questions:
- ๐ Open an issue
- ๐ฌ Start a discussion
- ๐ง Email: nabingupta68@gmail.com