How nanosof/rag-jira-confluence-using-ai works
Purpose and entry points
This is a containerizable enterprise RAG service for ingesting Confluence/Jira content, indexing it locally, and answering grounded questions through a FastAPI web/API interface. Runtime entry point is main.py; deployment is defined by Dockerfile and docker-compose.yml.
API and application orchestration
main.py hosts FastAPI/Uvicorn, serves the chat UI at /, accepts prompts at POST /api/chat, and triggers ingestion at POST /api/sync. It is the boundary between browser/API clients and the RAG/indexing subsystems.
• main.py
• rag_engine.py
• scheduler.py
Source synchronization and crawling
The crawler layer connects to Confluence and Jira APIs using configured service credentials, retrieves documentation and related content, and feeds normalized source material into indexing. There are two crawler-named modules, suggesting the .p.py variant may be an alternate/prototype implementation and should be reconciled before extending crawl behavior.
• confluence_crawler.py
• confluence_crawler.p.py
• scheduler.py
Content extraction and multimodal enrichment
Raw page content is transformed into retrieval-ready text. This includes preserving HTML tables as Markdown and processing attached/embedded media. Diagram and architecture-image analysis is delegated to Anthropic Claude Vision, producing searchable textual descriptions rather than storing only opaque image assets.
• media_processor.py
• confluence_crawler.py
• chunker.py
Chunking and embedding pipeline
Extracted text is segmented into chunks before embedding. SentenceTransformers with the local all-MiniLM-L6-v2 model generates vectors, separating local semantic indexing from cloud LLM/vision calls. The sync pipeline should be treated as the write path into the knowledge base.
• chunker.py
• rag_engine.py
• database.py
Local vector persistence and retrieval
SQLite plus sqlite-vec is the embedded persistence and nearest-neighbor retrieval boundary. It provides durable local vector search, likely persisted via Docker volumes, and avoids an external vector database. Retrieval results are passed to the RAG engine as the only intended evidence base for answers.
• database.py
• rag_engine.py
• docker-compose.yml
Grounded answer generation
rag_engine.py implements the query path: embed the user prompt, retrieve relevant chunks, construct grounded context, and call Claude 3.5 Sonnet for the final response. The principal trust boundary is between retrieved internal content and the external Anthropic API: prompts should constrain generation to retrieved evidence.
• rag_engine.py
• database.py
• main.py
Background operation and infrastructure
APScheduler drives recurring refreshes so source changes can be reflected without user requests; /api/sync provides a manual equivalent. Material external services are Confluence/Jira APIs and Anthropic’s API. Python 3.11+, FastAPI/Uvicorn, SentenceTransformers, SQLite/sqlite-vec, and Docker Compose form the operational stack.
• scheduler.py
• requirements.txt
• .env.example
Main entry points: rag_engine.py RAG engine · confluence_crawler.py Confluence/Jira crawler · main.py FastAPI service · .env.example Service credentials
Components 15
API & orchestration
- Browser / API client
- FastAPI service · Serves chat UI plus chat and manual-sync endpoints.
main.py - Recurring sync scheduler
scheduler.py
Sync write path
- Confluence/Jira crawler
confluence_crawler.py - Alternate crawler · Crawler variant that should be reconciled before extension.
confluence_crawler.p.py - Media enrichment · Converts diagrams and architecture images into searchable text.
media_processor.py - Text chunker · Preserves tables as Markdown and segments extracted content.
chunker.py
Local knowledge base
- MiniLM embeddings · SentenceTransformers all-MiniLM-L6-v2.
- SQLite + sqlite-vec · Durable local chunk and nearest-neighbor index.
database.py - Docker Compose · Provides container runtime and persistent local storage.
docker-compose.yml
Grounded answer path
- RAG engine · Indexes chunks and answers only from retrieved evidence.
rag_engine.py
External services
- Confluence & Jira
- Claude Vision
- Claude 3.5 Sonnet · Generates final grounded responses.
- Service credentials · Credentials for source systems and Anthropic.
.env.example
Connections 21
- Browser / API client → FastAPI service: chat and sync requests
- FastAPI service → Recurring sync scheduler: starts recurring refresh
- FastAPI service → Confluence/Jira crawler: manual /api/sync
- Recurring sync scheduler → Confluence/Jira crawler: scheduled sync
- Confluence/Jira crawler → Confluence & Jira: fetches content
- Alternate crawler → Confluence & Jira: alternate implementation
- Confluence/Jira crawler → Media enrichment: embedded media
- Media enrichment → Claude Vision: image analysis
- Media enrichment → Text chunker: enriched text
- Confluence/Jira crawler → Text chunker: normalized pages
- Text chunker → RAG engine: chunks for indexing
- RAG engine → MiniLM embeddings: embeds chunks and prompts
- RAG engine → SQLite + sqlite-vec: writes chunks and vectors
- SQLite + sqlite-vec → RAG engine: retrieved evidence
- FastAPI service → RAG engine: chat prompt
- RAG engine → Claude 3.5 Sonnet: grounded context and prompt
- RAG engine → FastAPI service: answer
- Docker Compose → SQLite + sqlite-vec: persistent volume
- Service credentials → Confluence/Jira crawler: source credentials
- Service credentials → Claude Vision: API credential
- Service credentials → Claude 3.5 Sonnet: API credential