Run Cognee From Source
If you like to run cognee from its source to try and learn from the examples, build your own logic and extend cognee functionality - you are in the right place.
Running from source gives you access to the latest features, allows you to customize cognee for your specific needs, and enables you to contribute back to the community.
Clone cognee Repository
Option 1: Clone for Usage Only
If you just want to use the latest version from source:
git clone https://github.com/topoteretes/cognee.git
cd cognee
Option 2: Fork and Clone for Development
If you plan to make changes or contribute back:
-
Fork the repository: Go to cognee repository and click “Fork”
-
Clone your fork:
git clone https://github.com/<your-github-username>/cognee.git
cd cognee
- Add upstream remote (for staying up-to-date):
git remote add upstream https://github.com/topoteretes/cognee.git
Development Setup
Install Dependencies
Navigate to the cognee directory and install in development mode:
# Install cognee in editable mode
pip install -e .
# Or if you prefer using virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e .
Environment Configuration
- Set up environment variables:
# Create a .env file in the project root
echo 'LLM_API_KEY="YOUR_OPENAI_API_KEY"' > .env
- Configure your database (optional):
- By default, cognee uses Kuzu, LanceDB, and SQLite - so you don’t have to change anything unless you want to use other database options
- Check the .env.template for detailed config options.
Running Examples
Explore the examples in the repository to understand how cognee works. In the examples folder, you can find scripts that runs simple examples for core concepts of cognee.
1. Start Here
python/simple_example.py
- Basic conceptspython/cognee_simple_document_demo.py
- Simple file processingpython/multimedia_example.py
- Multi-modal processing
2. Core Features & Complex Scenarios
python/simple_node_set_example.py
- Node organizationpython/code_graph_example.py
- Code analysispython/agentic_reasoning_procurement_example.py
- Agentic reasoningpython/dynamic_steps_example.py
- Dynamic pipelinespython/ontology_demo_example.py
- Custom ontologieslow_level/pipeline.py
- Custom pipeline development
Using Community Plugins
The cognee-community repository hosts community-managed plugins and adapters for Cognee. These extend cognee’s functionality with additional vector databases, graph stores, and other integrations.
Installing Community Packages
You can install community packages using UV (recommended) or pip:
# Install using UV (recommended)
uv pip install cognee-community-vector-adapter-qdrant
# Or install using pip
pip install cognee-community-vector-adapter-qdrant
Available Community Adapters
The community repository includes several adapter packages:
Package Name | Type | Description |
---|---|---|
cognee-community-vector-adapter-qdrant | Vector | Qdrant vector database adapter for cognee |
cognee-community-vector-adapter-azure | Vector | Azure AI search vector database adapter for cognee |
cognee-community-vector-adapter-redis | Vector | Redis vector database adapter for cognee |
Using Community Adapters
- Navigate to the adapter directory and check examples:
# Clone the community repository to explore
git clone https://github.com/topoteretes/cognee-community.git
cd cognee-community
# Navigate to the specific adapter e.g.,
cd packages/vector/redis/examples
# Check the example usage
python example.py
- Set up environment variables:
# Each adapter has its own requirements
# Check the adapter's README.md for specific configuration
Getting Help
If you encounter issues while running from source:
- Check the Issue Tracker for known issues
- Join our Discord Community for real-time help
- Open a new issue if you find a bug
Contributing Back
Once you have cognee running from source:
- Look for good first issues
- Review the Code of Conduct
- Follow the contribution guidelines
- Submit pull requests with the Developer Certificate of Origin sign-off
Next Steps
Now that you have cognee running from source:
- Explore the codebase structure
- Try modifying examples to understand the architecture
- Consider contributing improvements or new features
- Join the community discussions on Discord