A premium graph-relational visualization and query dashboard that maps human connections in FalkorDB and explores them using an autonomous AI Agent built on the Google Antigravity SDK.
The application is structured into a 3-tier topology linking the user interface, the graph database, and the autonomous AI agent:
┌────────────────────────────────────────────────────────┐
│ Client UI │
│ (Streamlit Web Application) │
└───────────┬───────────────────────────────▲────────────┘
│ │
│ 1. Submit Person Data │ 4. Render Results
▼ │
┌───────────────────────────────┴────────────────────────┐
│ Python Backend Engine │
│ (FalkorDB Client & Agent Interface) │
└───────────┬───────────────────────────────▲────────────┘
│ │
│ 2. Cypher Queries │ 3. Schema & Data
▼ │
┌──────────────────────────────┐ ┌──────────┴────────────┐
│ FalkorDB │ │ Google GenAI Agent │
│ (Docker Instance) │ │ (NL to Cypher Tool) │
└──────────────────────────────┘ └───────────────────────┘
- Data Tier: FalkorDB (Redis-compatible, high-performance graph database) running inside Docker.
- Application Tier: A Streamlit dashboard utilizing custom CSS glassmorphism components to capture entity relations and prompt natural language questions.
- Agent Tier: A Google Antigravity SDK Agent that automatically converts natural language questions to Cypher queries, retrieves results, and synthesizes answers.
The graph database schema is modeled with a single node label (Person) and a single directed relationship type (RELATES_TO).
graph LR
P1[Person] -- "RELATES_TO {type, sentiment}" --> P2[Person]
Represent individuals in the network.
- Label:
Person - Properties:
name(String): The unique name/identifier of the person.location(String): The geographical location of the person.
Directed edges representing how one person views or interacts with another.
- Type:
RELATES_TO - Properties:
type(String): The category of relationship (e.g.,friend,spouse,boss,employee,sibling,enemy,colleague,partner,other).sentiment(String): The emotional level of the relationship (e.g.,hate,dislike,neutral,like,love).
- Backend & Ingestion: Python 3.11+ / Streamlit 1.58
- Graph Database: FalkorDB (via Docker image
falkordb/falkordb:latest) - AI Agent Framework: Google Antigravity SDK (
google-antigravity==0.1.3) - Validation: Pydantic v2
- Docker & Docker Compose installed.
- Python 3.11+ installed.
- A Gemini API Key (obtained from Google AI Studio).
-
Clone the repository and navigate into it:
cd relation_db -
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Configure Environment Variables: Create a
.envfile in the root directory:# Gemini API Credentials GOOGLE_API_KEY=your_gemini_api_key_here # FalkorDB Credentials FALKORDB_HOST=localhost FALKORDB_PORT=6379 GRAPH_NAME=relationships_graph
-
Start FalkorDB Instance: Spin up the graph database container in detached mode:
docker compose up -d
To verify graph database operations and make sure connections are active, execute the test suite:
pytestLaunch the visual web dashboard:
streamlit run src/app.pyThis runs the dashboard locally. Open the provided URL (e.g., http://localhost:8502) in your browser to view the interface.
You can also run the Natural Language query interface directly from your terminal:
python src/agent.py --query "Who is enemies with Alice?"├── .env # Environment configuration
├── docker-compose.yml # Docker setup for FalkorDB
├── requirements.txt # Project library dependencies
├── src/
│ ├── app.py # Streamlit dashboard layout and frontend controller
│ ├── agent.py # Google Antigravity agent & NL translation tool
│ └── database.py # FalkorDB client query and ingestion manager
└── tests/
└── test_database.py # Automated integration tests