Skip to Content
TutorialsRun from source (SDK, community adapters and your own tasks)

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:

  1. Fork the repository: Go to cognee repository and click “Fork”

  2. Clone your fork:

git clone https://github.com/<your-github-username>/cognee.git cd cognee
  1. 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

  1. Set up environment variables:
# Create a .env file in the project root echo 'LLM_API_KEY="YOUR_OPENAI_API_KEY"' > .env
  1. 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 concepts
  • python/cognee_simple_document_demo.py - Simple file processing
  • python/multimedia_example.py - Multi-modal processing

2. Core Features & Complex Scenarios

  • python/simple_node_set_example.py - Node organization
  • python/code_graph_example.py - Code analysis
  • python/agentic_reasoning_procurement_example.py - Agentic reasoning
  • python/dynamic_steps_example.py - Dynamic pipelines
  • python/ontology_demo_example.py - Custom ontologies
  • low_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 NameTypeDescription
cognee-community-vector-adapter-qdrantVectorQdrant vector database adapter for cognee
cognee-community-vector-adapter-azureVectorAzure AI search vector database adapter for cognee
cognee-community-vector-adapter-redisVectorRedis vector database adapter for cognee

Using Community Adapters

  1. 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
  1. 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:

  1. Check the Issue Tracker for known issues
  2. Join our Discord Community for real-time help
  3. Open a new issue if you find a bug

Contributing Back

Once you have cognee running from source:

  1. Look for good first issues
  2. Review the Code of Conduct
  3. Follow the contribution guidelines
  4. 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