RAG Server
A FastMCP-based Retrieval-Augmented Generation server for dynamically ingesting public documents and querying them on-the-fly. This server implements the Model Context Protocol (MCP) to enable seamless integration between AI models and external data sources.
Features
- Document ingestion from public URLs (PDF, DOCX, DOC)
- Hybrid vector search using both OpenAI and Google Gemini embeddings
- Session-based context management via MCP
- Automatic fallback and retry mechanisms for embedding generation
- Support for chunking and overlapping text segments
Installation
uv pip install -e .
Tools
The server exposes the following MCP tools defined in src/rag_server/server.py:
ingest_urls
Description: Ingest a list of public URLs (PDF, DOCX, DOC) into an ephemeral session. Returns a session_id for querying. You can pass an existing session_id to ingest into a specific session.
Signature: ingest_urls(urls: list[str], session_id: Optional[str] = None) -> str
urls: List of public document URLs to ingest.session_id(optional): Existing session identifier.
query_knowledge
Description: Query the ingested documents in the given session using RAG. Returns a generated answer.
Signature: query_knowledge(session_id: str, question: str) -> str
session_id: Session identifier where documents were ingested.question: The question to query against ingested documents.
Metadata
Release files for rag_server 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rag_server-0.0.2.tar.gz | 97.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rag_server-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 104.7 kB
Release files / rag_server-0.0.2.tar.gz
| Download URL | rag_server-0.0.2.tar.gz |
|---|---|
| Size | 97.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df3524e384ad94c44c352e4e9c79da380a5601a28a580ff264897bcfffe71f2f
|
|
BLAKE2b-256 checksum How to use checksums |
fd0a4a4a249c8dd51fe34a83f9c62c52051ba1df006a172e4ac0e29a2785bf3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Release files / rag_server-0.0.2-py3-none-any.whl
| Download URL | rag_server-0.0.2-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e0bee822e886da2b144824c07ebee909610f72f6fc9ad599a99c58442808a1f
|
|
BLAKE2b-256 checksum How to use checksums |
29e98dff97b16c03e611a57d1333fc4fb2fc477c5879684a29e681015fc257b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|