Skip to main content
AG2 (formerly AutoGen) is an open-source agentic AI operating system (AgentOS) for building, orchestrating, and deploying multi-agent AI systems. Developed from OpenAI and Microsoft Research’s AutoGen, AG2 provides a modular framework for creating sophisticated AI agents that can collaborate, use tools, and integrate with knowledge graphs. The integration of AG2 with FalkorDB brings powerful GraphRAG capabilities to multi-agent systems, enabling agents to leverage structured knowledge graphs for more accurate, explainable, and contextually-aware responses.

Installation

Install AG2 with FalkorDB GraphRAG support:
Or install the GraphRAG-SDK separately:

Quick Start

1. Set Up FalkorDB

Start FalkorDB using Docker:
Or use FalkorDB Cloud for a managed instance.

2. Configure Environment

Set up your API credentials:

3. Create a GraphRAG Agent

Advanced Usage

Multi-Agent Collaboration

Build a multi-agent system where agents collaborate using shared knowledge:

Building Knowledge Graphs from Multiple Sources

Custom Query Engine Configuration

Conversational Context Management

Human-in-the-Loop Workflows

Integrating External Tools

Use Cases

  • Multi-Agent Research Systems: Teams of agents collaborating to research complex topics using knowledge graphs
  • Customer Support Automation: Intelligent agents answering queries with contextual knowledge from company databases
  • Business Intelligence: Agents analyzing business data and providing strategic insights
  • Content Generation: Creating factually accurate content grounded in knowledge graphs
  • Decision Support Systems: Multi-agent systems helping humans make informed decisions
  • Knowledge Management: Automated extraction and organization of information from documents
  • Trip Planning: Collaborative agents using graph data for personalized travel recommendations

Key Features

GraphRAG Advantages

  • Structured Knowledge: Query relationships and entities in a graph database
  • Reduced Hallucinations: Ground agent responses in factual graph data
  • Explainable AI: Trace reasoning paths through graph queries
  • Real-Time Updates: Knowledge graphs can be updated dynamically
  • Multi-Tenancy: Isolate knowledge graphs for different projects or users
  • High Performance: FalkorDB’s speed enables real-time agent interactions

AG2 Core Capabilities

  • Multi-Agent Orchestration: Coordinate multiple AI agents with different roles
  • LLM Agnostic: Works with OpenAI, Google, Anthropic, Azure, and more
  • Tool Integration: Agents can use external APIs, databases, and functions
  • Human-in-the-Loop: Seamlessly integrate human oversight and feedback
  • State Management: Maintain conversation context and agent state
  • Flexible Workflows: Define custom agent behaviors and interaction patterns

Best Practices

  1. Schema Design: Structure your knowledge graph with clear entities and relationships
  2. Document Quality: Provide high-quality, well-structured input documents for better graph extraction
  3. Agent Roles: Define clear, specific roles for each agent in multi-agent systems
  4. Error Handling: Implement fallback mechanisms for failed queries or agent responses
  5. Context Management: Balance context window size with response quality
  6. Query Optimization: Use specific, targeted queries for better performance
  7. Incremental Updates: Update knowledge graphs incrementally as new data arrives
  8. Security: Implement proper authentication and authorization for graph access
  9. Monitoring: Track agent performance and query patterns for optimization
  10. Testing: Validate agent behavior with diverse query scenarios

Performance Considerations

  • Batch Processing: Process multiple documents in batches for efficient graph building
  • Caching: Cache frequently accessed graph patterns and results
  • Connection Pooling: Reuse FalkorDB connections across agents
  • Parallel Queries: Execute independent queries in parallel when possible
  • Graph Optimization: Regularly optimize graph structure for query performance

Resources

Frequently Asked Questions

AG2 (formerly AutoGen) is an open-source multi-agent AI framework developed from OpenAI and Microsoft Research. It integrates with FalkorDB through the GraphRAG-SDK, enabling agents to query structured knowledge graphs for more accurate, explainable, and context-aware responses.
Install with pip: pip install -U ag2[openai,graph-rag-falkor-db]. This installs AG2 with OpenAI and FalkorDB GraphRAG capabilities. Alternatively, install ag2 and graphrag_sdk separately.
FalkorGraphRagCapability is the AG2 capability that attaches GraphRAG-powered knowledge retrieval to any AG2 agent. Once attached, the agent can automatically query the FalkorDB knowledge graph to ground its responses in factual data.
Yes. You can create multi-agent systems where different agents (e.g., researcher, analyst, writer) all access the same FalkorDB knowledge graph through their own FalkorGraphRagCapability instances, enabling collaborative workflows grounded in shared knowledge.
Yes. Set human_input_mode='ALWAYS' on a supervisor agent to require human approval for critical decisions while AI agents use GraphRAG for data-driven recommendations. This enables safe, supervised multi-agent systems.