Pale Fire is an intelligent Knowledge Graph Search System that transforms data points into human-readable narratives. It features:
- Question-Type Detection: Automatically understands WHO/WHERE/WHEN/WHAT/WHY/HOW questions.
- NER Enrichment: Extracts and tags 18+ entity types (PER, LOC, ORG, DATE, etc.).
- 5-Factor Ranking: Combines semantic, connectivity, temporal, query matching, and entity-type intelligence.
- AI Agent Daemon: Keeps gensim and spacy models loaded for instant access.
palefire-cli.py: Main CLI application.api.py: REST API server.modules/: Core functionality (PaleFireCore, KeywordBase).agents/: AI Agent daemon and file parsers.prompts/: LLM prompts.docs/: Extended documentation.
# Start all services
docker-compose up -d
# Initial setup (pull models)
make setup- Install Dependencies:
pip install -r requirements.txt python -m spacy download en_core_web_sm pip install gensim>=4.3.0 websockets youtube-transcript-api - Configuration:
cp env.example .env # Edit .env with Neo4j and Ollama settings
| Command | Description |
|---|---|
make up |
Start all services |
make down |
Stop all services |
make logs |
View logs |
make setup |
Pull necessary models |
make ingest-demo |
Ingest demo data |
make clean-db |
Clean Neo4j database |
- Ingest:
python palefire-cli.py ingest --demoorpython palefire-cli.py ingest --file <file> - Query:
python palefire-cli.py query "Your question?" - Config:
python palefire-cli.py config - Clean:
python palefire-cli.py clean --confirm - Keywords:
python palefire-cli.py keywords "Text" --method combined
- Start:
python palefire-cli.py agent start --daemon - Status:
python palefire-cli.py agent status - Stop:
python palefire-cli.py agent stop
# Run all tests
pytest
# Run specific suite
pytest tests/test_ai_agent.py -v
# Run with coverage
./run_tests.sh coverageThe Ghostwriter functionality enables Palefire to act as an intelligent research assistant by ingesting content from URLs, indexing it in a vector database (Qdrant), and using RAG (Retrieval-Augmented Generation) to answer questions.
- Qdrant: Vector database for storing content embeddings.
- Ollama: Local LLM server for generating responses and embeddings.
- Dependencies:
qdrant-client,sentence-transformers.
Run the interactive init command to set up your environment:
python palefire-cli.py initThis will prompt you for:
OLLAMA_HOST: URL of your Ollama instance (default:http://localhost:11434/v1)QDRANT_HOST: Hostname of your Qdrant instance (default:localhost)GHOSTWRITER_UI_CONTAINER/PORT: For integration links
Download and index content from a URL.
# Basic ingestion
python palefire-cli.py ghostwriter ingest "https://example.com/article"
# Ingest into a specific collection
python palefire-cli.py ghostwriter ingest "https://example.com/ai-news" --collection ai-knowledgeAsk questions based on the ingested knowledge.
# Ask using default collection
python palefire-cli.py ghostwriter ask "Summarize the article."
# Ask from a specific collection
python palefire-cli.py ghostwriter ask "What are the key findings?" --collection ai-knowledgeSearch for relevant text chunks without generating an answer.
python palefire-cli.py ghostwriter search "neural networks" --collection ai-knowledgeList all available knowledge collections.
python palefire-cli.py ghostwriter collections-
Chunking: Content is automatically split into manageable chunks with overlap to ensure context preservation.
-
Source Tracking: Every answer includes citations to the source URL.
-
Error Handling: Automatically handles SSL verification issues (in test mode) and connection retries.
-
Error Handling: Automatically handles SSL verification issues (in test mode) and connection retries.
Palefire provides an MCP server compatible with clients like Claude Desktop, allowing LLMs to directly invoke Ghostwriter tools.
python mcp_server.pyAdd the following to your claude_desktop_config.json:
{
"mcpServers": {
"palefire": {
"command": "docker",
"args": [
"compose",
"run",
"--rm",
"-T",
"mcp-server"
],
"cwd": "/absolute/path/to/palefire",
"env": {
"PATH": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
}
}
}
}Note: Replace /absolute/path/to/palefire with the actual path to your project. The -T flag is critical to disable pseudo-TTY allocation, which interferes with MCP communication.
ingest_url(url, collection_name)ask_question(question, collection_name)search_content(query, collection_name)list_collections()
- Daemon not starting: Check if
palefire_ai_agent.pidexists in/tmp/and remove it if the process is dead. - Neo4j Connection: Verify credentials in
.envand that Neo4j is running on port 7687. - Missing Models: Run
python -m spacy download en_core_web_smormake setupfor Docker. - Ghostwriter Unavailable: Ensure
qdrant-clientandsentence-transformersare installed.